home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / scl120.arc / SCL120.DOC < prev    next >
Text File  |  1990-09-07  |  443KB  |  15,910 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.                               SCL1 C - FUNCTION LIBRARY
  28.  
  29.                                      VERSION 2.0
  30.  
  31.                                   REFERENCE MANUAL
  32.  
  33.                              COPYRIGHT (C) 1989,1990 BY:
  34.  
  35.                                 JOSE RODRIGUEZ ALVIRA
  36.                                          AND
  37.                                    JOSE R. LEBRON
  38.  
  39.  
  40.  
  41.  
  42.  
  43.                           SCL1 Version 2.0 Reference Manual
  44.  
  45.  
  46.                                   TABLE OF CONTENTS
  47.  
  48.           OVERVIEW . . . . . . . . . . . . . . . . . . . . . . . . . .    1
  49.  
  50.           DISCLAIMER . . . . . . . . . . . . . . . . . . . . . . . . .    2
  51.  
  52.           USING SCL1 . . . . . . . . . . . . . . . . . . . . . . . . .    3
  53.  
  54.           WHAT IS SSG  . . . . . . . . . . . . . . . . . . . . . . . .    3
  55.  
  56.           SCL1DEMO . . . . . . . . . . . . . . . . . . . . . . . . . .    3
  57.  
  58.           FUNCTION REFERENCE . . . . . . . . . . . . . . . . . . . . .    4
  59.  
  60.           ALPHABETICAL REFERENCE . . . . . . . . . . . . . . . . . . .    5
  61.                AddExtension  . . . . . . . . . . . . . . . . . . . . .    5
  62.                BackgroundOff . . . . . . . . . . . . . . . . . . . . .    6
  63.                BackgroundOn  . . . . . . . . . . . . . . . . . . . . .    7
  64.                Beep  . . . . . . . . . . . . . . . . . . . . . . . . .    8
  65.                BigCursor . . . . . . . . . . . . . . . . . . . . . . .    9
  66.                Bin2Ascii . . . . . . . . . . . . . . . . . . . . . . .   10
  67.                Box . . . . . . . . . . . . . . . . . . . . . . . . . .   11
  68.                Buf2Disk  . . . . . . . . . . . . . . . . . . . . . . .   13
  69.                Calendar  . . . . . . . . . . . . . . . . . . . . . . .   14
  70.                Center  . . . . . . . . . . . . . . . . . . . . . . . .   18
  71.                ChangeDumpColor . . . . . . . . . . . . . . . . . . . .   19
  72.                ChangeExtension . . . . . . . . . . . . . . . . . . . .   20
  73.                CheckBarMenu  . . . . . . . . . . . . . . . . . . . . .   21
  74.                CheckChar . . . . . . . . . . . . . . . . . . . . . . .   23
  75.                CheckItemList . . . . . . . . . . . . . . . . . . . . .   24
  76.                CheckMouse  . . . . . . . . . . . . . . . . . . . . . .   26
  77.                CheckMouseButton  . . . . . . . . . . . . . . . . . . .   27
  78.                ClearKeyBuf . . . . . . . . . . . . . . . . . . . . . .   29
  79.                CloseFile . . . . . . . . . . . . . . . . . . . . . . .   30
  80.                Cls . . . . . . . . . . . . . . . . . . . . . . . . . .   31
  81.                CreateFile  . . . . . . . . . . . . . . . . . . . . . .   32
  82.                CursorOff . . . . . . . . . . . . . . . . . . . . . . .   33
  83.                CursorOn  . . . . . . . . . . . . . . . . . . . . . . .   33
  84.                DeleteFile  . . . . . . . . . . . . . . . . . . . . . .   34
  85.                DialogBox . . . . . . . . . . . . . . . . . . . . . . .   35
  86.                DisableMouse  . . . . . . . . . . . . . . . . . . . . .   36
  87.                DrawBarMenu . . . . . . . . . . . . . . . . . . . . . .   37
  88.                DrawBoxLine . . . . . . . . . . . . . . . . . . . . . .   39
  89.                DrawItemList  . . . . . . . . . . . . . . . . . . . . .   40
  90.                DrawLine  . . . . . . . . . . . . . . . . . . . . . . .   42
  91.                DrawMouseButton . . . . . . . . . . . . . . . . . . . .   43
  92.                ErrorBox  . . . . . . . . . . . . . . . . . . . . . . .   45
  93.                ErrorShadowOff  . . . . . . . . . . . . . . . . . . . .   47
  94.                ErrorShadowOn . . . . . . . . . . . . . . . . . . . . .   47
  95.  
  96.                                       Page -i-
  97.  
  98.  
  99.  
  100.  
  101.  
  102.                           SCL1 Version 2.0 Reference Manual
  103.  
  104.  
  105.                                   TABLE OF CONTENTS
  106.  
  107.                FieldCheck  . . . . . . . . . . . . . . . . . . . . . .   48
  108.                Fields  . . . . . . . . . . . . . . . . . . . . . . . .   50
  109.                Fields2 . . . . . . . . . . . . . . . . . . . . . . . .   54
  110.                FileBox . . . . . . . . . . . . . . . . . . . . . . . .   62
  111.                FileBox2  . . . . . . . . . . . . . . . . . . . . . . .   63
  112.                File2Buf  . . . . . . . . . . . . . . . . . . . . . . .   66
  113.                FillBlock . . . . . . . . . . . . . . . . . . . . . . .   68
  114.                FindFirst . . . . . . . . . . . . . . . . . . . . . . .   69
  115.                FindNext  . . . . . . . . . . . . . . . . . . . . . . .   69
  116.                GetCurCol . . . . . . . . . . . . . . . . . . . . . . .   73
  117.                GetCurLine  . . . . . . . . . . . . . . . . . . . . . .   73
  118.                GetCurrentDir . . . . . . . . . . . . . . . . . . . . .   74
  119.                GetCurSize  . . . . . . . . . . . . . . . . . . . . . .   75
  120.                GetDate . . . . . . . . . . . . . . . . . . . . . . . .   76
  121.                GetDefaultDrive . . . . . . . . . . . . . . . . . . . .   78
  122.                GetDiskFreeSpace  . . . . . . . . . . . . . . . . . . .   79
  123.                GetExtendedAscii  . . . . . . . . . . . . . . . . . . .   80
  124.                GetFiles  . . . . . . . . . . . . . . . . . . . . . . .   82
  125.                GetFileMode . . . . . . . . . . . . . . . . . . . . . .   83
  126.                GetFilePt . . . . . . . . . . . . . . . . . . . . . . .   85
  127.                GetFileSize . . . . . . . . . . . . . . . . . . . . . .   87
  128.                GetFreeMem  . . . . . . . . . . . . . . . . . . . . . .   89
  129.                GetKey  . . . . . . . . . . . . . . . . . . . . . . . .   90
  130.                GetString . . . . . . . . . . . . . . . . . . . . . . .   91
  131.                GetTime . . . . . . . . . . . . . . . . . . . . . . . .   93
  132.                GSSBox  . . . . . . . . . . . . . . . . . . . . . . . .   94
  133.                HideMouse . . . . . . . . . . . . . . . . . . . . . . .   96
  134.                InitMouse . . . . . . . . . . . . . . . . . . . . . . .   97
  135.                InitUserError . . . . . . . . . . . . . . . . . . . . .   98
  136.                InitVideo . . . . . . . . . . . . . . . . . . . . . . .  100
  137.                KeyReady  . . . . . . . . . . . . . . . . . . . . . . .  102
  138.                KeyStatus . . . . . . . . . . . . . . . . . . . . . . .  103
  139.                LineEditor  . . . . . . . . . . . . . . . . . . . . . .  104
  140.                ListManager . . . . . . . . . . . . . . . . . . . . . .  111
  141.                ListWindow  . . . . . . . . . . . . . . . . . . . . . .  113
  142.                MakeDir . . . . . . . . . . . . . . . . . . . . . . . .  120
  143.                Menu  . . . . . . . . . . . . . . . . . . . . . . . . .  121
  144.                MenuSys . . . . . . . . . . . . . . . . . . . . . . . .  123
  145.                MenuSystem  . . . . . . . . . . . . . . . . . . . . . .  128
  146.                MessageOff  . . . . . . . . . . . . . . . . . . . . . .  138
  147.                MessageOn . . . . . . . . . . . . . . . . . . . . . . .  139
  148.                MessageShadowOff  . . . . . . . . . . . . . . . . . . .  140
  149.                MessageShadowOn . . . . . . . . . . . . . . . . . . . .  140
  150.                MouseButton . . . . . . . . . . . . . . . . . . . . . .  141
  151.                MouseMenu . . . . . . . . . . . . . . . . . . . . . . .  145
  152.                MoveFilePt  . . . . . . . . . . . . . . . . . . . . . .  148
  153.                MoveFilePt2Off  . . . . . . . . . . . . . . . . . . . .  150
  154.  
  155.                                       Page -ii-
  156.  
  157.  
  158.  
  159.  
  160.  
  161.                           SCL1 Version 2.0 Reference Manual
  162.  
  163.  
  164.                                   TABLE OF CONTENTS
  165.  
  166.                OpenFile  . . . . . . . . . . . . . . . . . . . . . . .  152
  167.                PushCursor  . . . . . . . . . . . . . . . . . . . . . .  154
  168.                PopCursor . . . . . . . . . . . . . . . . . . . . . . .  154
  169.                PopMenu . . . . . . . . . . . . . . . . . . . . . . . .  155
  170.                ReadFile  . . . . . . . . . . . . . . . . . . . . . . .  157
  171.                RemoveDir . . . . . . . . . . . . . . . . . . . . . . .  158
  172.                RemoveExtension . . . . . . . . . . . . . . . . . . . .  159
  173.                RenameFile  . . . . . . . . . . . . . . . . . . . . . .  160
  174.                ResetMouse  . . . . . . . . . . . . . . . . . . . . . .  161
  175.                ResetMouseCur . . . . . . . . . . . . . . . . . . . . .  162
  176.                ScreenDump  . . . . . . . . . . . . . . . . . . . . . .  163
  177.                ScrollDown  . . . . . . . . . . . . . . . . . . . . . .  164
  178.                ScrollList  . . . . . . . . . . . . . . . . . . . . . .  165
  179.                ScrollUp  . . . . . . . . . . . . . . . . . . . . . . .  167
  180.                ScrollWindow  . . . . . . . . . . . . . . . . . . . . .  168
  181.                Select  . . . . . . . . . . . . . . . . . . . . . . . .  176
  182.                SetCurPos . . . . . . . . . . . . . . . . . . . . . . .  180
  183.                SetCurSize  . . . . . . . . . . . . . . . . . . . . . .  181
  184.                SetDialogColor  . . . . . . . . . . . . . . . . . . . .  182
  185.                SetErrorBoxColor  . . . . . . . . . . . . . . . . . . .  183
  186.                SetFileMode . . . . . . . . . . . . . . . . . . . . . .  184
  187.                SetHorLimit . . . . . . . . . . . . . . . . . . . . . .  186
  188.                SetInt24Color . . . . . . . . . . . . . . . . . . . . .  187
  189.                SetMouseCur . . . . . . . . . . . . . . . . . . . . . .  188
  190.                SetMouseIsr . . . . . . . . . . . . . . . . . . . . . .  189
  191.                SetMousePos . . . . . . . . . . . . . . . . . . . . . .  191
  192.                SetShadowColor  . . . . . . . . . . . . . . . . . . . .  192
  193.                SetUserBox  . . . . . . . . . . . . . . . . . . . . . .  193
  194.                SetUserBoxLine  . . . . . . . . . . . . . . . . . . . .  195
  195.                SetVerLimit . . . . . . . . . . . . . . . . . . . . . .  196
  196.                SetVideoMode  . . . . . . . . . . . . . . . . . . . . .  197
  197.                SetVideoPage  . . . . . . . . . . . . . . . . . . . . .  198
  198.                SetVideo4350  . . . . . . . . . . . . . . . . . . . . .  199
  199.                SetVideo25  . . . . . . . . . . . . . . . . . . . . . .  199
  200.                Shadow  . . . . . . . . . . . . . . . . . . . . . . . .  200
  201.                ShowMouse . . . . . . . . . . . . . . . . . . . . . . .  201
  202.                SortPointers  . . . . . . . . . . . . . . . . . . . . .  202
  203.                Sound . . . . . . . . . . . . . . . . . . . . . . . . .  203
  204.                SoundOff  . . . . . . . . . . . . . . . . . . . . . . .  204
  205.                SoundOn . . . . . . . . . . . . . . . . . . . . . . . .  204
  206.                StopWatch . . . . . . . . . . . . . . . . . . . . . . .  205
  207.                TagItem . . . . . . . . . . . . . . . . . . . . . . . .  206
  208.                TagList . . . . . . . . . . . . . . . . . . . . . . . .  209
  209.                TagList2  . . . . . . . . . . . . . . . . . . . . . . .  211
  210.                TagMenu . . . . . . . . . . . . . . . . . . . . . . . .  215
  211.                Textwindow  . . . . . . . . . . . . . . . . . . . . . .  218
  212.                TrapInt23 . . . . . . . . . . . . . . . . . . . . . . .  222
  213.  
  214.                                      Page -iii-
  215.  
  216.  
  217.  
  218.  
  219.  
  220.                           SCL1 Version 2.0 Reference Manual
  221.  
  222.  
  223.                                   TABLE OF CONTENTS
  224.  
  225.                TrapInt24 . . . . . . . . . . . . . . . . . . . . . . .  223
  226.                TSound  . . . . . . . . . . . . . . . . . . . . . . . .  224
  227.                Video . . . . . . . . . . . . . . . . . . . . . . . . .  225
  228.                VideoConfig . . . . . . . . . . . . . . . . . . . . . .  226
  229.                WaitKeyMouse  . . . . . . . . . . . . . . . . . . . . .  228
  230.                WaitTime  . . . . . . . . . . . . . . . . . . . . . . .  228
  231.                WFileBox  . . . . . . . . . . . . . . . . . . . . . . .  229
  232.                Window  . . . . . . . . . . . . . . . . . . . . . . . .  232
  233.                WriteChar . . . . . . . . . . . . . . . . . . . . . . .  234
  234.                WriteFile . . . . . . . . . . . . . . . . . . . . . . .  235
  235.                WriteOffLen . . . . . . . . . . . . . . . . . . . . . .  236
  236.                WriteOffset . . . . . . . . . . . . . . . . . . . . . .  237
  237.                WriteScreen . . . . . . . . . . . . . . . . . . . . . .  238
  238.                WriteScreen . . . . . . . . . . . . . . . . . . . . . .  239
  239.                YesNo . . . . . . . . . . . . . . . . . . . . . . . . .  241
  240.                YesNoShadowOff  . . . . . . . . . . . . . . . . . . . .  242
  241.                YesNoShadowOn . . . . . . . . . . . . . . . . . . . . .  242
  242.  
  243.           APPENDIX "A" - FILE RELATED FUNCTIONS  . . . . . . . . . . .  243
  244.  
  245.           APPENDIX "B" - MOUSE FUNCTIONS . . . . . . . . . . . . . . .  246
  246.  
  247.           APPENDIX "C" - SCREEN RELATED FUNCTIONS  . . . . . . . . . .  248
  248.  
  249.           APPENDIX "D" - SCL1 HEADER FILES . . . . . . . . . . . . . .  250
  250.  
  251.           APPENDIX "E" - DIALOG TYPE FUNCTIONS . . . . . . . . . . . .  251
  252.  
  253.           APPENDIX "F" - CHANGES IN SCL1 VERSION 2.0 . . . . . . . . .  262
  254.  
  255.           REGISTRATION INFORMATION . . . . . . . . . . . . . . . . . .  265
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.                                       Page -iv-
  274.  
  275.  
  276.  
  277.  
  278.  
  279.                           SCL1 Version 2.0 Reference Manual
  280.  
  281.           OVERVIEW
  282.  
  283.           The functions included here provide an alternative to the
  284.           standard C-library functions.  Extensive screen handling and
  285.           mouse handling functions are provided that are not found in the
  286.           standard library.  Every effort has been made to exploit the PC
  287.           hardware to its maximum capacity, portability has not been a
  288.           primary goal.  The library is designed to work with the Microsoft
  289.           and the Borland Turbo-C C Compilers.  The Shareware version
  290.           contains stand alone small memory model libraries for both
  291.           compilers.
  292.  
  293.           You do not need to understand the internal workings of the
  294.           functions in order to take full advantage of them, all you need
  295.           to know is how to call them and how to pass the required
  296.           parameters.
  297.  
  298.           SCL1 is distributed under the Shareware concept.  Feel free to
  299.           try it, if you like and use the product please register your
  300.           copy.  Upon registration you will receive the following:
  301.  
  302.                1.   The latest version of SCL1.
  303.  
  304.                2.   Library modules for the small, medium, compact and
  305.                     large and huge memory models for the compiler of your
  306.                     choice.
  307.  
  308.                3.   SSG, a screen editor and program generator for use with
  309.                     SCL1. (see the included SSG Reference Manual)
  310.  
  311.                4.   You will be notified of all updates, additions and
  312.                     revisions.
  313.  
  314.           Feel free to distribute the Shareware version of SCL1 for trial
  315.           use by others on a private non-commercial basis.  The only
  316.           distribution conditions are: that the code must not be modified
  317.           or altered, and that no fee (except the nominal cost of
  318.           distribution) may be charged.
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.                                       Page -1-
  333.  
  334.  
  335.  
  336.  
  337.  
  338.                           SCL1 Version 2.0 Reference Manual
  339.  
  340.           DISCLAIMER
  341.  
  342.           The functions included in this package are, to the best of our
  343.           knowledge, original or use standard accepted algorithms.  We make
  344.           no claim that these functions are optimized or totally suited for
  345.           commercial use.  They have been thoroughly tested and, to the
  346.           best of our knowledge, perform as this documentation describe. 
  347.           We cannot  accept any responsibility for any problems which may
  348.           occur through the use of these functions for any application. 
  349.           After examining this document or the demo files included, if you
  350.           feel that this package is not suitable for your use, please do
  351.           not use it.
  352.  
  353.           THIS SOFTWARE AND MANUAL ARE SOLD "AS IS" AND WITHOUT WARRANTIES
  354.           AS TO PERFORMANCE OF MERCHANTABILITY OR ANY OTHER WARRANTIES
  355.           WHETHER EXPRESSED OR IMPLIED.  BECAUSE OF THE VARIOUS HARDWARE
  356.           AND SOFTWARE ENVIRONMENTS INTO WHICH THIS PROGRAM MAY BE PUT, NO
  357.           WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED.
  358.  
  359.           GOOD DATA PROCESSING PROCEDURE DICTATES THAT ANY PROGRAM BE
  360.           THOROUGHLY TESTED WITH NON-CRITICAL DATA BEFORE RELYING ON IT. 
  361.           THE USER MUST ASSUME THE ENTIRE RISK OF USING THE PROGRAM.  ANY
  362.           LIABILITY OF THE SELLER WILL BE LIMITED EXCLUSIVELY TO PRODUCT
  363.           REPLACEMENT OR REFUND OF PURCHASE PRICE.
  364.  
  365.           Feel free to send any comments or suggestions even if you do not
  366.           decide to register your copy.  If you find any bugs please let us
  367.           know so that they can be traced and fixed.  Please include with
  368.           your comments any relevant information, such as; hardware
  369.           configuration, description of the bug or problem and if possible
  370.           a section of the problem code.  Currently we can only support
  371.           this program by mail.
  372.  
  373.           INSTALLING SCL1
  374.  
  375.           All the files that are required to install SCL1 are distributed
  376.           in a compressed self extracting form.  You can use the included
  377.           INSTALL.EXE program to perform the installation or you can
  378.           manually decompress and copy them to the corresponding drives or
  379.           directories.  If you are using Microsoft C or Quick C copy the
  380.           library files starting with M to the drive or directory where you
  381.           have all your library files and the header file to the drive or
  382.           directory where you have your include files.  If you are using
  383.           Turbo C use the files starting with T instead. The library files
  384.           for the different memory models are identified with the last
  385.           letter.
  386.  
  387.  
  388.  
  389.  
  390.  
  391.                                       Page -2-
  392.  
  393.  
  394.  
  395.  
  396.  
  397.                           SCL1 Version 2.0 Reference Manual
  398.  
  399.           USING SCL1
  400.  
  401.           To use SCL1 make sure you include the preprocessor directive;
  402.           #include <SCL1.H> in your program.  Several other header files
  403.           are included with the keys, colors and music notes definitions.
  404.  
  405.           WHAT IS SSG
  406.  
  407.           You can really take the most advantage of SCL1 with an auxiliary
  408.           program called SSG.  SSG is a full featured screen editor and
  409.           program generator.  It will provide the required tools for
  410.           building program screens and menus.  After you design your
  411.           screen, you instruct SSG about the desired operations you want to
  412.           perform, such as: saving the screen contents, making a window,
  413.           clearing all or part of the screen, making a menu, etc.  Then SSG
  414.           will write the C code for the desired operations using the
  415.           functions available in SCL1.  You can merge the generated code
  416.           into your program.  SSG will help you in speeding the most time
  417.           consuming tasks during programming.
  418.  
  419.           A demo of SSG and its complete documentation is included in the
  420.           Shareware version of SCL1.  Upon registration you will receive a
  421.           full working copy of SSG.
  422.  
  423.           SCL1DEMO
  424.  
  425.           The program SCL1DEMO demonstrates some of the functions
  426.           available.  It was written using SCL1 with the help of SSG.  The
  427.           best way to discover about SCL1's features is to run this demo. 
  428.           To start the demo type SCL1DEMO at the DOS prompt.  You can
  429.           obtain the source code for the Demo program by calling TECH-BBS,
  430.           see Appendix "F".
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.                                       Page -3-
  451.  
  452.  
  453.  
  454.  
  455.  
  456.                           SCL1 Version 2.0 Reference Manual
  457.  
  458.  
  459.           FUNCTION REFERENCE
  460.  
  461.           An alphabetical reference of all the functions is included in
  462.           this documentation manual.  The reference provide full a
  463.           description of each function.  A uniform format has been used in
  464.           this reference.  At the top right corner of each page the name of
  465.           the function or functions discussed in that page are shown to let
  466.           you quickly locate a desired function.  The format used is as
  467.           follows:
  468.  
  469.                                                               Function Name
  470.  
  471.           Function:    Function Name
  472.  
  473.           Purpose:     A description of what the function does.
  474.  
  475.           Declaration: Function prototype.  The parameters types are shown. 
  476.                        All the function prototypes have been included in
  477.                        the header file SCL1.H so it is not necessary to
  478.                        declare them in your programs.
  479.  
  480.           Returns:     What the function returns.
  481.  
  482.           Parameters:  A description of the parameters, structures, arrays,
  483.                        buffers, etc. required by the function are
  484.                        explained.
  485.  
  486.           Messages:    In the dialog type functions, messages are exchanged
  487.                        with the function.  This section describe these
  488.                        messages.
  489.  
  490.           Example:     A short example of the function usage.
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.                                       Page -4-
  510.  
  511.  
  512.  
  513.  
  514.  
  515.                           SCL1 Version 2.0 Reference Manual
  516.  
  517.  
  518.                                ALPHABETICAL REFERENCE
  519.  
  520.                                                                AddExtension
  521.  
  522.           Function:    AddExtension
  523.  
  524.           Purpose:     Adds an extension to a filename if the filename has
  525.                        no extension and does not end with a period.
  526.  
  527.           Declaration: char *AddExtension(char *Filename, char *Extension);
  528.  
  529.           Returns:     The return value is a pointer to the filename
  530.                        buffer.
  531.  
  532.           Parameters:
  533.  
  534.               Filename - char pointer to filename.
  535.  
  536.              Extension - char pointer to string holding the extension.
  537.  
  538.           Example:
  539.  
  540.           #include <scl1.h>
  541.  
  542.           char Filename[13]="FILE";
  543.  
  544.           main()
  545.              {
  546.              printf("%s\n",Filename);
  547.              printf("%s\n",AddExtension(Filename,"C"));
  548.              }
  549.  
  550.           See also ChangeExtension and RemoveExtension
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.                                       Page -5-
  569.  
  570.  
  571.  
  572.  
  573.  
  574.                           SCL1 Version 2.0 Reference Manual
  575.  
  576.  
  577.                                                               BackgroundOff
  578.  
  579.           Function:    BackgroundOff
  580.  
  581.           Purpose:     Stops a function running in the background.
  582.  
  583.           Declaration: void BackgroundOff(void);
  584.  
  585.           Returns:     Nothing
  586.  
  587.           Parameters:  None
  588.  
  589.           Example:
  590.  
  591.           #include <slc1.h>
  592.  
  593.           main()
  594.              {
  595.              BackgroundOn(B_Function);
  596.              .
  597.              .
  598.              BackgroundOff();
  599.              }
  600.  
  601.           Notes:
  602.  
  603.              It is very important to stop any background running function
  604.              before returning to DOS.  Failure to do so can result in a
  605.              system crash.
  606.  
  607.           See also BackgroundOn.
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.                                       Page -6-
  628.  
  629.  
  630.  
  631.  
  632.  
  633.                           SCL1 Version 2.0 Reference Manual
  634.  
  635.  
  636.                                                                BackgroundOn
  637.  
  638.           Function:    BackgroundOn
  639.  
  640.           Purpose:     Makes a function share microprocessor time with a
  641.                        main process (run in the background).
  642.  
  643.           Declaration: void BackgroundOn(int (*FAddress)());
  644.  
  645.           Returns:     Nothing
  646.  
  647.           Parameters:
  648.  
  649.               FAddress - Pointer to the function that will be set to run in
  650.                          the background.  It will be called 18.2 times per
  651.                          second.
  652.  
  653.           Example:
  654.  
  655.           #include <slc1.h>
  656.  
  657.           main()
  658.              {
  659.              BackgroundOn(B_Function);
  660.              .
  661.              .
  662.              BackgroundOff();
  663.              }
  664.  
  665.           Notes:
  666.  
  667.              Functions that run in the background mode must not perform
  668.              disk or keyboard input/output or call any time or sound
  669.              related function.  You should avoid using any standard library
  670.              function that calls DOS or that uses the stack heavily. 
  671.              SCL1's screen related functions (except GSSBox) and the
  672.              standard library data manipulation functions are generally
  673.              safe to use in background mode.  Background functions are
  674.              called 18.2 per second.  Each time they are called they should
  675.              do as little as possible and return control to the calling
  676.              routine.
  677.  
  678.              If you are using a Microsoft compiler you might need to
  679.              disable the compiler's stack checking option using the
  680.              "#pragma check_stack(off)" directive.
  681.  
  682.  
  683.  
  684.  
  685.  
  686.                                       Page -7-
  687.  
  688.  
  689.  
  690.  
  691.  
  692.                           SCL1 Version 2.0 Reference Manual
  693.  
  694.  
  695.                                                                        Beep
  696.  
  697.           Function:    Beep
  698.  
  699.           Purpose:     Sends a beep tone to the console speaker.
  700.  
  701.           Declaration: void Beep(void);
  702.  
  703.           Returns:     Nothing
  704.  
  705.           Parameters:  None
  706.  
  707.           Example:
  708.  
  709.           #include <scl1.h>
  710.  
  711.           main()
  712.              {
  713.              Beep();   /* Sends a short beep to the console.*/
  714.              }
  715.           See also SoundOn, SoundOff and TSound
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.                                       Page -8-
  746.  
  747.  
  748.  
  749.  
  750.  
  751.                           SCL1 Version 2.0 Reference Manual
  752.  
  753.  
  754.                                                                   BigCursor
  755.  
  756.           Function:    BigCursor
  757.  
  758.           Purpose:     Changes the cursor size to a block.
  759.  
  760.           Declaration: void BigCursor(void);
  761.  
  762.           Returns:     Nothing
  763.  
  764.           Parameters:  None
  765.  
  766.           Example:
  767.  
  768.           #include <scl1.h>
  769.  
  770.           main()
  771.              {
  772.              BigCursor(); /* Turns the cursor to a block. */
  773.              }
  774.  
  775.           See also SetCurSize, GetCurCol, GetCurLine.
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.                                       Page -9-
  805.  
  806.  
  807.  
  808.  
  809.  
  810.                           SCL1 Version 2.0 Reference Manual
  811.  
  812.  
  813.                                                                   Bin2Ascii
  814.  
  815.           Function:    Bin2Ascii
  816.  
  817.           Purpose:     Fills a buffer with the ASCII code of a long integer
  818.                        value, adding commas, (i.e. 12,345). The buffer must
  819.                        be big enough to hold all characters plus commas and
  820.                        a zero (for terminating the string).
  821.  
  822.           Declaration: char *Bin2Ascii(long Number,char * Buffer);
  823.  
  824.           Returns:     The return value is a pointer to the buffer.
  825.  
  826.           Parameters:
  827.  
  828.                 Number - number whose ASCII value is to be written into the
  829.                          buffer (long integer).
  830.  
  831.                 Buffer - char pointer to the buffer to hold the ASCII
  832.                          string.
  833.  
  834.           Example:
  835.  
  836.           #include <scl1.h>
  837.  
  838.           #define WIDTH 7
  839.  
  840.           main()
  841.           {
  842.           long l;
  843.           char buffer[8];
  844.           int i;
  845.  
  846.           l=999999;
  847.           Cls(7,CLS_ALL);
  848.           for(i=0;i < 6;++i,l/=10)
  849.               {
  850.               WriteScreenLen(7,10,10,WIDTH,Bin2Ascii(l,buffer));
  851.               GetKey();
  852.               }
  853.           }
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.                                       Page -10-
  864.  
  865.  
  866.  
  867.  
  868.  
  869.                           SCL1 Version 2.0 Reference Manual
  870.  
  871.  
  872.                                                                         Box
  873.  
  874.           Function:    Box
  875.  
  876.           Purpose:     Draws a box with one of 12 predefined types of
  877.                        frames.  The row and column coordinates, color and
  878.                        frame type are specified.  The minimum box size is 2
  879.                        rows and 2 columns.  The function does not perform
  880.                        bound checking, the box will spill out of the screen
  881.                        area if the coordinates are outside the screen
  882.                        range.  The function draws only the box's frame and
  883.                        does not fill the box's interior.  If you desire to
  884.                        fill the box area use the GSSBox function instead. 
  885.                        If you want to draw a shadow effect, make sure to
  886.                        leave enough space outside the box area.  You can
  887.                        define other types of frames using the SetUserBox
  888.                        function.
  889.  
  890.           Declaration: void Box(int Color,int FrameType, int UpperRow,  
  891.                             int LeftCol, int LowerRow, int RightCol);
  892.  
  893.           Returns:     Nothing
  894.  
  895.           Parameters:
  896.  
  897.                  Color - color attribute for the prompt (integer).
  898.  
  899.              FrameType - frame type, an integer value from 0 to 11 as
  900.                          follows, box frame 12 selects a user defined
  901.                          frame:
  902.  
  903.                ╔═════════╗ ┌─────────┐ ╓─────────╖ ╒═════════╕  ╒════════╕
  904.                ║ FRAME 0 ║ │ FRAME 1 │ ║ FRAME 2 ║ │ FRAME 3 │  │ FRAME 4│
  905.                ╚═════════╝ └─────────┘ ╙─────────╜ ╘═════════╛  └────────┘
  906.  
  907.                            ▄▄▄▄▄▄▄▄▄▄  ░░░░░░░░░░░  ▒▒▒▒▒▒▒▒▒▒  ▓▓▓▓▓▓▓▓▓▓
  908.                  FRAME 5   ▌ FRAME 6▐  ░ FRAME 7 ░  ▒FRAME 8 ▒  ▓FRAME 9 ▓
  909.                            ▀▀▀▀▀▀▀▀▀▀  ░░░░░░░░░░░  ▒▒▒▒▒▒▒▒▒▒  ▓▓▓▓▓▓▓▓▓▓
  910.  
  911.                ██████████  **********
  912.                █FRAME 10█  *FRAME 11*
  913.                ██████████  **********
  914.  
  915.              (Note: You will not be able to print the correct frame types
  916.              if your printer does not support the IBM extended ASCII
  917.              character set.)
  918.  
  919.  
  920.  
  921.  
  922.                                       Page -11-
  923.  
  924.  
  925.  
  926.  
  927.  
  928.                           SCL1 Version 2.0 Reference Manual
  929.  
  930.  
  931.                                                                         Box
  932.  
  933.               UpperRow - upper row coordinate of the box (integer).
  934.  
  935.                LeftCol - left column coordinate of the box (integer).
  936.  
  937.               LowerRow - lower row coordinate of the box (integer).
  938.  
  939.               RightCol - right column coordinate of the box (integer).
  940.  
  941.           (Note: the home position is row 0, column 0.)
  942.  
  943.           Example:
  944.  
  945.           #include <scl1.h>
  946.           #include <scl1clor.h>
  947.  
  948.           int Color1=WHITE_BLACK;
  949.  
  950.           main()
  951.              {
  952.              Box(Color1,6,2,18,16,67);
  953.              /* Draws a box starting in line 2, column 16 and ending in
  954.                 line 18, column 67 with a small solid border.*/
  955.              }
  956.  
  957.           See also GSSBox, Shadow, SetShadowColor, SetUserFrame.
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.                                       Page -12-
  982.  
  983.  
  984.  
  985.  
  986.  
  987.                           SCL1 Version 2.0 Reference Manual
  988.  
  989.  
  990.                                                                    Buf2Disk
  991.  
  992.           Function:    Buf2Disk
  993.  
  994.           Purpose:     Saves a buffer to disk.
  995.  
  996.           Declaration: int Buf2Disk(char* Filename, char *Buffer,
  997.                            unsigned int Bytes);
  998.  
  999.           Returns:     The return value is "0" if no error occurs or the
  1000.                        DOS error code if an error occurs.  (See Appendix
  1001.                        "A", FILE FUNCTIONS, for more information).
  1002.  
  1003.           Parameters:
  1004.  
  1005.               Filename - filename (and path if needed) of file to write
  1006.                          data to (char pointer).
  1007.  
  1008.                 Buffer - buffer that holds the data to be written to disk
  1009.                          (char pointer).
  1010.  
  1011.                  Bytes - variable that holds the number of bytes to write
  1012.                          (unsigned integer).
  1013.  
  1014.           Example:
  1015.  
  1016.           #include <scl1.h>
  1017.  
  1018.           char buffer[]="We'll write this data to disk and read it
  1019.                          back.\n";
  1020.  
  1021.           main()
  1022.              {
  1023.              int Error;
  1024.              unsigned int size;
  1025.  
  1026.              if(Error=Buf2Disk("FILE.1",buffer,sizeof(buffer)))
  1027.                 {
  1028.                 printf("Error writing file # %i\n",Error);
  1029.                 exit(-1);
  1030.                 }
  1031.              size=sizeof(buffer);
  1032.              memset(buffer,0,size);
  1033.              if(Error=File2Buf("FILE.1",buffer,&size))
  1034.                 printf("Error reading file # %i\n",Error);
  1035.              else
  1036.                 printf("%s\n",buffer);
  1037.              }
  1038.           See also File2Buf and TrapInt24.
  1039.  
  1040.                                       Page -13-
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.                           SCL1 Version 2.0 Reference Manual
  1047.  
  1048.  
  1049.                                                                    Calendar
  1050.  
  1051.           Function:    Calendar
  1052.  
  1053.           Purpose:     Displays a calendar for a given month and year. A
  1054.                        day can be displayed in a different color.  This
  1055.                        function can display the calendar either in the
  1056.                        english or spanish language. The calendar position
  1057.                        can be set to anywhere within the screen. No bounds
  1058.                        checking is made so it is important to carefully
  1059.                        calculate the display position.  This is a dialog
  1060.                        type function. Messages are defined for initializing
  1061.                        the calendar to the present system date and to
  1062.                        browse through dates using the cursor keys.
  1063.  
  1064.           Declaration: int Calendar(Message, CData *cd);
  1065.  
  1066.           Returns:     This is a dialog type function. See Appendix "E" for
  1067.                        a description of the general operation of these
  1068.                        functions. The return values are the messages
  1069.                        described in the Messages section.
  1070.  
  1071.           Parameters:
  1072.  
  1073.           The calendar information is passed in a structure type CData as
  1074.           follows:
  1075.  
  1076.           typedef struct{
  1077.              int NColor;
  1078.              int RColor;
  1079.              int Row;
  1080.              int Col;
  1081.              int FrameType;
  1082.              unsigned int *ExitKeys;
  1083.              int Lang;
  1084.              int Month;
  1085.              int Day;
  1086.              int Year;
  1087.              unsigned int EventInfo;
  1088.              }CData;
  1089.  
  1090.           where;
  1091.  
  1092.                 NColor - normal color attributes for the calendar display
  1093.                          (integer).
  1094.  
  1095.                 RColor - reversed color attributes for displaying the
  1096.                          selected day (integer).
  1097.  
  1098.  
  1099.                                       Page -14-
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.                           SCL1 Version 2.0 Reference Manual
  1106.  
  1107.  
  1108.                                                                    Calendar
  1109.  
  1110.                    Row - row position for the upper left corner of the
  1111.                          calendar (integer).
  1112.  
  1113.                    Col - column position for the upper left corner of the
  1114.                          calendar (integer).
  1115.  
  1116.              FrameType - type of frame to be used to enclose the calendar,
  1117.                          it can be any of the frame types that can be used
  1118.                          with the Box or GSSBox functions (integer).
  1119.  
  1120.               ExitKeys - an array of keys that will exit the calendar
  1121.                          function(unsigned integer).
  1122.  
  1123.                   Lang - a flag to define the language to be used when
  1124.                          displaying the calendar. To display the calendar
  1125.                          in english set Lang to "0", to display the
  1126.                          calendar in spanish set Lang to "1" (integer).
  1127.  
  1128.                  Month - the month to be displayed (integer).
  1129.  
  1130.                    Day - the day to be displayed (integer).
  1131.  
  1132.                   Year - the year to be displayed (integer).
  1133.  
  1134.              EventInfo - variable that holds the key pressed when you exit
  1135.                          the function or a non defined key is pressed
  1136.                          (unsigned integer).
  1137.  
  1138.           Messages:
  1139.  
  1140.           The following messages can be sent to Calendar:
  1141.  
  1142.                    C_INIT - initialize the CData structure to NULL and sets
  1143.                             the following default values:
  1144.  
  1145.                             NColor - set to white characters in a black
  1146.                                      background or the normal color defined
  1147.                                      by calling SetDialogColors.
  1148.  
  1149.                             HColor - set to highlighted white characters in
  1150.                                      a black background or the highlight
  1151.                                      color defined by calling
  1152.                                      SetDialogColors.
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.                                       Page -15-
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.                           SCL1 Version 2.0 Reference Manual
  1165.  
  1166.  
  1167.                                                                    Calendar
  1168.  
  1169.                                Col - set to column "24" for 80 column
  1170.                                      displays or to column "12" for 40
  1171.                                      column displays. These row positions
  1172.                                      have been selected to display the
  1173.                                      calendar in the middle of the screen.
  1174.  
  1175.                                Row - set to row "5".
  1176.  
  1177.                               Lang - set to display the calendar in
  1178.                                      english.
  1179.  
  1180.                              Month - set to the current system's month.
  1181.  
  1182.                                Day - set to the current system's day.
  1183.  
  1184.                               Year - set to the current system's year.
  1185.  
  1186.                          FrameType - set to frame type "0" (double line).
  1187.  
  1188.                           ExitKeys - defined as ENTER, ESCAPE, TAB &
  1189.                                      SHIFTAB.
  1190.  
  1191.                    C_DRAW - display the calendar with the current display
  1192.                             parameters.
  1193.  
  1194.                  C_ACTIVE - display the calendar with the current display
  1195.                             parameters and let the user change the date
  1196.                             data using the cursor movement keys as follows:
  1197.  
  1198.                          Key                      action
  1199.  
  1200.                        Up Arrow         cursor one day up.
  1201.                        Down Arrow       cursor one day down.
  1202.                        Left Arrow       cursor one day to the left.
  1203.                        Right Arrow      cursor one day to the right.
  1204.                        Page Up          increment the month by one.
  1205.                        Page Down        decrement the month by one.
  1206.                        +                increment the year by one.
  1207.                        -                decrement the year by one.
  1208.  
  1209.             C_CHECK_MOUSE - asks the function if the mouse has been clicked
  1210.                             while pointing the calendar area (while
  1211.                             currently the mouse does not affect the
  1212.                             Calendar's operation, this messages is
  1213.                             necessary when using this function as a field
  1214.                             in the Fields2 function).
  1215.  
  1216.  
  1217.                                       Page -16-
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.                           SCL1 Version 2.0 Reference Manual
  1224.  
  1225.  
  1226.                                                                    Calendar
  1227.  
  1228.               C_SHADOW_ON - displays a shadow effect the next time the
  1229.                             calendar is drawn.
  1230.  
  1231.              C_SHADOW_OFF - disables the shadow effect.
  1232.  
  1233.                   C_RESET - when this message is sent the Day, Month and
  1234.                             Year variables set to the system's date. If the
  1235.                             exit keys have not been defined they are set to
  1236.                             the default exit keys.
  1237.  
  1238.           The following messages can be returned by Calendar:
  1239.  
  1240.                      C_OK - the action requested has been performed.
  1241.  
  1242.                C_EXIT_KEY - a key that has been defined as an exit key has
  1243.                             been pressed.
  1244.  
  1245.             C_MOUSE_EVENT - the mouse has been clicked after pointing
  1246.                             outside the area defined by the function.
  1247.  
  1248.             C_ILLEGAL_KEY - a key that has not been defined has been
  1249.                             pressed.
  1250.  
  1251.            C_NEW_POSITION - this message is returned every time the month,
  1252.                             year or day has been changed.
  1253.  
  1254.                C_MY_MOUSE - this message is returned in response to the
  1255.                             C_CHECK_MOUSE message if the mouse has been
  1256.                             pressed in the Calendar screen area.
  1257.  
  1258.           Example:
  1259.  
  1260.           #include <scl1.h>
  1261.  
  1262.           main()
  1263.              {
  1264.              int Mess;                    /* returned messages         */
  1265.              CData test;                  /* define test as type CData */
  1266.  
  1267.              Calendar(C_INIT,&test);      /* Initialize to defaults    */
  1268.              Calendar(C_SHADOW_ON,&test); /* Display with shadow effect*/
  1269.              Calendar(C_DRAW,&test);      /* Display the calendar       */
  1270.              do {                         /* loop until exit key */
  1271.                 Mess=Calendar(C_ACTIVE,&test); /* browse through the
  1272.                                                   the calendar */
  1273.                 }while (Mess!=C_EXIT_KEY);
  1274.              }
  1275.  
  1276.                                       Page -17-
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.                           SCL1 Version 2.0 Reference Manual
  1283.  
  1284.  
  1285.                                                                      Center
  1286.  
  1287.           Function:    Center
  1288.  
  1289.           Purpose:     Centers a string horizontally.
  1290.  
  1291.           Declaration: int Center(char *String);
  1292.  
  1293.           Returns:     Returns the column position required for displaying
  1294.                        the string centered in the screen.
  1295.  
  1296.           Parameters:
  1297.  
  1298.              String -  pointer to the string to be centered (char).
  1299.  
  1300.           Example:
  1301.  
  1302.           #include <slc1.h>
  1303.           #include <scl1clor.h>
  1304.  
  1305.           int Color1=WHITE_BLACK;
  1306.           char Txt[10]="Main Menu";
  1307.  
  1308.           main()
  1309.              {
  1310.              int Column;
  1311.  
  1312.              Column=Center(Txt);
  1313.              WriteString(Color1,1,Column,Txt);
  1314.              }
  1315.  
  1316.           or
  1317.  
  1318.           main()
  1319.              {
  1320.              WriteString(Color1,1,Center(Txt),Txt);
  1321.              }
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.                                       Page -18-
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.                           SCL1 Version 2.0 Reference Manual
  1342.  
  1343.  
  1344.                                                             ChangeDumpColor
  1345.  
  1346.           Function:    ChangeDumpColor
  1347.  
  1348.           Purpose:     Changes the color attributes of a ScreenDump array
  1349.                        (See ScreenDump).
  1350.  
  1351.           Declaration: void ChangeDumpColor(int OldColor, int NewColor,
  1352.                             char*Array);
  1353.  
  1354.           Returns:     Nothing
  1355.  
  1356.           Parameters:
  1357.  
  1358.               OldColor - color value you want to change (integer).
  1359.  
  1360.               NewColor - new color you desire (integer).
  1361.  
  1362.                 *Array - ScreenDump array (char pointer).
  1363.  
  1364.           Example:
  1365.  
  1366.           #include <scl1.h>
  1367.  
  1368.           char Array[]={'A',7,'B',0x70,\n,'C',0x70,'D',7,0};
  1369.  
  1370.           main()
  1371.              {
  1372.  
  1373.              /* Each character is followed by its color attribute, a \n can
  1374.                 be used to indicate end of lines and a "0" must be used to
  1375.                 indicate the end of the array */
  1376.  
  1377.                 ScreenDump(10,10,Array); /* Write at line 10, column 10 */
  1378.                 GetKey();
  1379.  
  1380.                 ChangeDumpColor(0x70,7,Array);
  1381.                 ScreenDump(10,10,Array); /* Write at line 10, column 10 */
  1382.                 /* Change all character attributes 0x17 to 7 */
  1383.              }
  1384.  
  1385.           See also ScreenDump.
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.                                       Page -19-
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.                           SCL1 Version 2.0 Reference Manual
  1401.  
  1402.  
  1403.                                                             ChangeExtension
  1404.  
  1405.           Function:    ChangeExtension
  1406.  
  1407.           Purpose:     Changes a filename's extension or adds an extension
  1408.                        if it does not has one.
  1409.  
  1410.           Declaration: char *ChangeExtension(char *Filename,
  1411.                             char *Extension);
  1412.  
  1413.           Returns:     The return value is a pointer to the filename
  1414.                        buffer.
  1415.  
  1416.           Parameters:
  1417.  
  1418.               Filename - filename to change its extension (char pointer).
  1419.  
  1420.              Extension - new extension (char pointer).
  1421.  
  1422.           Example:
  1423.  
  1424.           #include <scl1.h>
  1425.  
  1426.           char Buffer[]="MYFILE.TXT";
  1427.  
  1428.           main()
  1429.              {
  1430.              printf("%s\n",Buffer);
  1431.              ChangeExtension(Buffer,".BAK");
  1432.  
  1433.              /* Change extension from ".TXT" to ".BAK"*/
  1434.  
  1435.              printf("%s\n",Buffer);
  1436.              }
  1437.  
  1438.           See also AddExtension and RemoveExtension
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.                                       Page -20-
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.                           SCL1 Version 2.0 Reference Manual
  1460.  
  1461.  
  1462.                                                                CheckBarMenu
  1463.  
  1464.           Function:    CheckBarMenu  (OBSOLETE, use the MenuSystem
  1465.                                      function, this function will
  1466.                                      eventually be removed from future
  1467.                                      versions of SCL1.)
  1468.  
  1469.           Purpose:     Determines the number of the item selected with the
  1470.                        mouse in a bar menu.
  1471.  
  1472.           Declaration: int CheckBarMenu(int Number, struct BarMenu *bm);
  1473.  
  1474.           Returns:     The return value is the Selection number ( > "1") or
  1475.                        "0" if none has been selected.
  1476.  
  1477.           Parameters:
  1478.  
  1479.           The BarMenu information must be given as an array of structures
  1480.           as follows:
  1481.  
  1482.              struct BarMenu{
  1483.                 int StartCol,EndCol;
  1484.                 char String[20];
  1485.                 };
  1486.  
  1487.           where,
  1488.  
  1489.               StartCol - column position where to start displaying the menu
  1490.                          item information (integer).
  1491.  
  1492.                 EndCol - column position where to end displaying the menu
  1493.                          item information (integer).
  1494.  
  1495.                 String - menu item information (char pointer).
  1496.  
  1497.           The parameters passed to the function are:
  1498.  
  1499.                 Number - number of menu options (integer).
  1500.  
  1501.                BarMenu - pointer to the BarMenu structure.
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.                                       Page -21-
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.                           SCL1 Version 2.0 Reference Manual
  1519.  
  1520.  
  1521.                                                                CheckBarMenu
  1522.  
  1523.           Example:
  1524.  
  1525.           #include <scl1.h>
  1526.           #include <scl1clor.h>
  1527.  
  1528.           /* Bar Menu structure */
  1529.  
  1530.           struct BarMenu bm[]={
  1531.              2,8,              /*Start and end of display*/
  1532.              "Option1",        /*Menu item information   */
  1533.              15,21,            /* Second menu option     */
  1534.              "Option2"};
  1535.  
  1536.           main()
  1537.              {
  1538.              int Selection=0;
  1539.  
  1540.              if(CheckMouse())
  1541.                 InitMouse(IM_SHOW);
  1542.              else
  1543.                 printf("No Mouse available\n");
  1544.              DrawBarMenu(BLACK_WHITE,WHITE_BLACK,2,Selection,bm);
  1545.              while(Selection==0)
  1546.                 {
  1547.                 if((Selection=CheckBarMenu(2,bm)))  /* Selection made? */
  1548.                    DrawBarMenu(BLACK_WHITE,WHITE_BLACK,2,Selection,bm);
  1549.                 }
  1550.              }
  1551.  
  1552.           NOTE: Use DrawBarMenu to draw bar menus.
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.                                       Page -22-
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.                           SCL1 Version 2.0 Reference Manual
  1578.  
  1579.  
  1580.                                                                   CheckChar
  1581.  
  1582.           Function:    CheckChar
  1583.  
  1584.           Purpose:     Checks for a valid keyboard character.
  1585.  
  1586.           Declaration: unsigned int CheckChar(unsigned int Character,
  1587.                                     unsigned int ControlCode);
  1588.  
  1589.           Returns:     The return value is the character, if valid, or "0"
  1590.                        if the character is not valid.
  1591.  
  1592.           Parameters:
  1593.  
  1594.              character - character to verify (unsigned integer).
  1595.  
  1596.            ControlCode - type of character to accept (unsigned integer).
  1597.  
  1598.                 Control codes defined in SCL1.H:
  1599.  
  1600.                    CC_ANY - accept any character.
  1601.                 CC_LETTER - only letters.
  1602.                  CC_DIGIT - only digits.
  1603.             CC_CAPITALIZE - capitalize.
  1604.                   CC_REAL - accept real numbers.
  1605.               CC_FILESPEC - accept valid filename characters
  1606.                CC_ESPANOL - letters & accented characters used in the
  1607.                             spanish language.
  1608.            CC_PUNCTUATION - accept (,;.+-* spaces,etc.)
  1609.                   CC_PATH - accept valid filenames and pathnames
  1610.                             characters.
  1611.                 CC_SEARCH - accept all characters of CC_PATH and the "*"
  1612.                             and "?" characters.
  1613.            CC_EXPONENTIAL - accept numbers in exponential form.
  1614.  
  1615.           Example:
  1616.  
  1617.           #include<scl1.h>
  1618.           #include<scl1keys.h>
  1619.  
  1620.           main()
  1621.              {
  1622.              unsigned int Key;
  1623.              Key=GetKey();
  1624.              if (CheckChar(Key,CC_LETTER))>0)
  1625.                    /* Character is valid */
  1626.              else
  1627.                    /* Character is invalid */
  1628.              }
  1629.  
  1630.                                       Page -23-
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.                           SCL1 Version 2.0 Reference Manual
  1637.  
  1638.  
  1639.                                                               CheckItemList
  1640.  
  1641.           Function:    CheckItemList
  1642.  
  1643.           Purpose:     Checks if the mouse has been clicked at any item in
  1644.                        an item list (see DrawItemList).
  1645.  
  1646.           Declaration: int CheckItemList(int Number, int ItemLength,
  1647.                            struct ItemList *il);
  1648.  
  1649.           Returns:     The return value is the number of the item selected
  1650.                        with the mouse (>"1") or "0" if none has been
  1651.                        selected.
  1652.  
  1653.           Parameters:
  1654.  
  1655.           The item list information must be given as an array of structures
  1656.           as follows:
  1657.  
  1658.              struct ItemList{
  1659.                 int Row,Col;
  1660.                 char *String;
  1661.                 };
  1662.  
  1663.           where,
  1664.  
  1665.                    Row - row position of the item (integer).
  1666.  
  1667.                    Col - column position of the item (integer).
  1668.  
  1669.                 String - char pointer to item text.
  1670.  
  1671.           The parameters passed to the function are:
  1672.  
  1673.                 Number - number of items (integer).
  1674.  
  1675.             ItemLength - maximum length of items (integer).
  1676.  
  1677.               ItemList - pointer to the defined structure.
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.                                       Page -24-
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.                           SCL1 Version 2.0 Reference Manual
  1696.  
  1697.  
  1698.                                                               CheckItemList
  1699.  
  1700.           Example:
  1701.  
  1702.           #include <scl1.h>
  1703.           #include <scl1clor.h>
  1704.  
  1705.           struct ItemList il[]={
  1706.              10,10,"String 1",
  1707.              10,30,"String 2",
  1708.              10,50,"String 3",
  1709.              };
  1710.  
  1711.           main()
  1712.              {
  1713.              int Selection=0;
  1714.  
  1715.              Cls(WHITE_BLACK,CLS_ALL);
  1716.              if(CheckMouse())
  1717.                 InitMouse(IM_SHOW);
  1718.              else
  1719.                 printf("No Mouse available\n");
  1720.              DrawItemList(WHITE_BLACK,BLACK_WHITE,3,Selection,il);
  1721.              while(Selection==0)
  1722.                 {
  1723.                 if(Selection=CheckItemList(3,8,il))
  1724.                    DrawItemList(WHITE_BLACK,BLACK_WHITE,3,Selection,il);
  1725.                 }
  1726.              }
  1727.  
  1728.           NOTE: Use DrawItemList to draw an ItemList structure to the
  1729.                 screen.  See also ListManager to integrate mouse and
  1730.                 keyboard.  The Dialog type function ListWindow provides an
  1731.                 alternative way to perform the same task.
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746.  
  1747.  
  1748.                                       Page -25-
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.                           SCL1 Version 2.0 Reference Manual
  1755.  
  1756.  
  1757.                                                                  CheckMouse
  1758.  
  1759.           Function:    CheckMouse
  1760.  
  1761.           Purpose:     Determines if a mouse is installed.  Sets variable
  1762.                        MSE_MouseFl to "1" if mouse is found.
  1763.  
  1764.           Declaration: int CheckMouse(void);
  1765.  
  1766.           Returns:     The return value of "1" if the mouse is installed
  1767.                        and "0" if no mouse is installed.
  1768.  
  1769.           Parameters:  None
  1770.  
  1771.           Example:
  1772.  
  1773.           #include <scl1.h>
  1774.  
  1775.           main()
  1776.              {
  1777.  
  1778.              /* do we have a mouse? */
  1779.              if(CheckMouse())
  1780.                 {
  1781.                 /* Yes */
  1782.                 ResetMouse();  /* reset mouse */
  1783.                 SetMouseIsr(); /* initialize ISR */
  1784.                 ShowMouse();   /* cursor on */
  1785.                 }
  1786.              .
  1787.              .
  1788.              .
  1789.              ResetMouse();  /* reset mouse before exit */
  1790.              }
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799.  
  1800.  
  1801.  
  1802.  
  1803.  
  1804.  
  1805.  
  1806.  
  1807.                                       Page -26-
  1808.  
  1809.  
  1810.  
  1811.  
  1812.  
  1813.                           SCL1 Version 2.0 Reference Manual
  1814.  
  1815.  
  1816.                                                            CheckMouseButton
  1817.  
  1818.           Function:    CheckMouseButton
  1819.  
  1820.           Purpose:     Checks if the mouse has been clicked at any screen
  1821.                        mouse button.
  1822.  
  1823.           Declaration: int CheckMouseButton(int Number,
  1824.                             struct MouseButton *p);
  1825.  
  1826.           Returns:     The return value is the number of the selected
  1827.                        screen Mouse Button or "0" if none has been
  1828.                        selected.
  1829.  
  1830.           Parameters:
  1831.  
  1832.           The Mouse Button information must be given in a structure as
  1833.           follows:
  1834.  
  1835.                 struct MouseButton{
  1836.                    int Top,Left,Bottom,Right;
  1837.                    int Row,Col;
  1838.                    char String[20];
  1839.                    };
  1840.  
  1841.           where,
  1842.  
  1843.                     Top -   upper line coordinate of the Mouse Button area
  1844.                             (integer).
  1845.  
  1846.                    Left -   upper column coordinate of the Mouse Button
  1847.                             area (integer).
  1848.  
  1849.                  Bottom -   right row coordinate of the Mouse Button area
  1850.                             (integer).
  1851.  
  1852.                   Right -   right column coordinate of the Mouse Button
  1853.                             area (integer).
  1854.  
  1855.                     Row -   row coordinate of the Mouse Button text
  1856.                             (integer).
  1857.  
  1858.                     Col -   column coordinate of the Mouse Button text
  1859.                             (integer).
  1860.  
  1861.                  String -   Mouse Button text (maximum of 19 characters.).
  1862.  
  1863.  
  1864.  
  1865.  
  1866.                                       Page -27-
  1867.  
  1868.  
  1869.  
  1870.  
  1871.  
  1872.                           SCL1 Version 2.0 Reference Manual
  1873.  
  1874.  
  1875.                                                            CheckMouseButton
  1876.  
  1877.           The parameters passed to the function are:
  1878.  
  1879.                  Number -   number of mouse buttons (integer).
  1880.  
  1881.               MouseButton - pointer to defined structure.
  1882.  
  1883.           Example:
  1884.  
  1885.           struct MouseButton mb[]={
  1886.              4,35,6,45,  /* Box coordinates */
  1887.              5,38,       /* String position */
  1888.              "Yes",      /* String */
  1889.  
  1890.              10,35,12,45,
  1891.              11,39,
  1892.              "No",
  1893.              };
  1894.  
  1895.           /* Call CheckMouseButton(Number of options, pointer to the
  1896.              structure). */
  1897.  
  1898.              if((Selection=CheckMouseButton(2,mb))) /* Bigger than 1? */
  1899.                 {                    /* Selection was made */
  1900.                 switch(Selection)
  1901.                    {
  1902.                    case 1:
  1903.                        .
  1904.                        .
  1905.                    case 2:
  1906.                        .
  1907.                        .
  1908.  
  1909.           See also DrawMouseButton to draw the buttons.
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.                                       Page -28-
  1926.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931.                           SCL1 Version 2.0 Reference Manual
  1932.  
  1933.  
  1934.                                                                 ClearKeyBuf
  1935.  
  1936.           Function:    ClearKeyBuf
  1937.  
  1938.           Purpose:     Clears keyboard buffer of any character or keystroke
  1939.                        pending to be processed.
  1940.  
  1941.           Declaration: void ClearKeyBuf(void);
  1942.  
  1943.           Returns:     Nothing.
  1944.  
  1945.           Parameters:  None.
  1946.  
  1947.           Example:
  1948.  
  1949.           #include <slc1.h>
  1950.  
  1951.           main()
  1952.              {
  1953.              ClearKeyBuf();
  1954.              }
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.                                       Page -29-
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.                           SCL1 Version 2.0 Reference Manual
  1991.  
  1992.  
  1993.                                                                   CloseFile
  1994.  
  1995.           Function:    CloseFile
  1996.  
  1997.           Purpose:     Closes a file.
  1998.  
  1999.           Declaration: int CloseFile(int Handle);
  2000.  
  2001.           Returns:     The return value is "0" if no error occurs or the
  2002.                        DOS error code if an error occurs.  (See Appendix
  2003.                        "A", FILE FUNCTIONS, for more information).
  2004.  
  2005.           Parameters:
  2006.  
  2007.                 Handle - Handle number is given by DOS when you create or
  2008.                          open a file (integer).
  2009.  
  2010.           Example:
  2011.  
  2012.           #include <scl1.h>
  2013.           /* This is the source code of the Buf2Disk function */
  2014.  
  2015.           Buf2Disk(char *Filename,char *Buffer,unsigned int Bytes)
  2016.              {
  2017.              int i,handle;
  2018.  
  2019.              if(i=CreateFile(Filename,&handle,F_ARCHIVE))
  2020.                 return(i);
  2021.  
  2022.              if(i=WriteFile(handle,Buffer,Bytes))
  2023.                 {
  2024.                 if(i > 0)
  2025.                    CloseFile(handle);
  2026.                 return(i);
  2027.                 }
  2028.              return(CloseFile(handle));
  2029.              }
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.                                       Page -30-
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.                           SCL1 Version 2.0 Reference Manual
  2050.  
  2051.  
  2052.                                                                         Cls
  2053.  
  2054.           Function:    Cls
  2055.  
  2056.           Purpose:     Clears a screen area.
  2057.  
  2058.           Declaration: void Cls(int Color,int UpperRow,int LeftCol,
  2059.                             int BottomRow, int RightCol);
  2060.  
  2061.           Returns:     Nothing
  2062.  
  2063.           Parameters:
  2064.  
  2065.                  Color - color attribute of the area to be cleared
  2066.                          (integer).
  2067.  
  2068.               UpperRow - upper row coordinate of the area to be cleared
  2069.                          (integer).
  2070.  
  2071.                LeftCol - left column coordinate of the area to be cleared
  2072.                          (integer).
  2073.  
  2074.               LowerRow - lower row coordinate of the area to be cleared.
  2075.                          (integer).
  2076.  
  2077.               RightCol - right column coordinate of the area to be
  2078.                          cleared.(integer).
  2079.  
  2080.           (Note: the top left position is 0, column 0.)
  2081.  
  2082.           Example:
  2083.  
  2084.           #include <scl1.h>
  2085.           #include <scl1clor.h>
  2086.  
  2087.           int Color1=WHITE_BLACK;
  2088.  
  2089.           main()
  2090.              {
  2091.              Cls(Color1,18,0,24,79);
  2092.              }
  2093.  
  2094.           or,
  2095.  
  2096.           main()
  2097.              {
  2098.              Cls(Color1,CLS_ALL); (CLS_ALL is defined in SCL1.H to clear
  2099.                                   the whole screen.)
  2100.              }
  2101.  
  2102.                                       Page -31-
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.                           SCL1 Version 2.0 Reference Manual
  2109.  
  2110.  
  2111.                                                                  CreateFile
  2112.  
  2113.           Function:    CreateFile
  2114.  
  2115.           Purpose:     Creates a new file or truncates an existing file to
  2116.                        zero.
  2117.  
  2118.           Declaration: int CreateFile(char *Filename,int *Handle,
  2119.                            int Attrib);
  2120.  
  2121.           Returns:     The return value is "0" if no error occurs or the
  2122.                        DOS error code if an error occurs.  (See Appendix
  2123.                        "A", FILE FUNCTIONS, for more information).
  2124.  
  2125.           Parameters:
  2126.  
  2127.               Filename - char pointer to a valid filename.
  2128.  
  2129.                 Handle - pointer to an integer variable that contains the
  2130.                          file handle number given by DOS (integer).
  2131.  
  2132.                 Attrib - type of file to create, Read only, hidden, etc.
  2133.                          (integer). The following types has been defined in
  2134.                          SCL1.H:
  2135.  
  2136.                          F_READ_ONLY, F_HIDDEN, F_SYSTEM, F_VOLUME,
  2137.                          F_DIRECTORY, F_ARCHIVE
  2138.  
  2139.           Example:
  2140.  
  2141.           #include <scl1.h>
  2142.           /* This is the source code of the Buf2Disk function */
  2143.  
  2144.           Buf2Disk(char *Filename,char *Buffer,unsigned int Bytes)
  2145.              {
  2146.              int i,handle;
  2147.  
  2148.              if(i=CreateFile(Filename,&handle,F_ARCHIVE))
  2149.                 return(i);
  2150.  
  2151.              if(i=WriteFile(handle,Buffer,Bytes))
  2152.                 {
  2153.                 if(i > 0)
  2154.                    CloseFile(handle);
  2155.                 return(i);
  2156.                 }
  2157.              return(CloseFile(handle));
  2158.              }
  2159.  
  2160.  
  2161.                                       Page -32-
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.                           SCL1 Version 2.0 Reference Manual
  2168.  
  2169.  
  2170.                                                                   CursorOff
  2171.                                                                    CursorOn
  2172.  
  2173.           Function:    CursorOff
  2174.                        CursorOn
  2175.  
  2176.           Purpose:     Turns the cursor off (cursor not visible), or on
  2177.                        (cursor visible).
  2178.  
  2179.           Declaration: void CursorOff(void);
  2180.                        void CursorOn(void);
  2181.  
  2182.           Returns:     Nothing
  2183.  
  2184.           Parameters:  None
  2185.  
  2186.           Example:
  2187.  
  2188.  
  2189.           #include <scl1.h>
  2190.  
  2191.           main()
  2192.              {
  2193.              CursorOff();
  2194.              printf("Press any key to turm cursor on\n");
  2195.              GetKey();
  2196.              CursorOn();
  2197.              }
  2198.  
  2199.  
  2200.  
  2201.  
  2202.  
  2203.  
  2204.  
  2205.  
  2206.  
  2207.  
  2208.  
  2209.  
  2210.  
  2211.  
  2212.  
  2213.  
  2214.  
  2215.  
  2216.  
  2217.  
  2218.  
  2219.  
  2220.                                       Page -33-
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.                           SCL1 Version 2.0 Reference Manual
  2227.  
  2228.  
  2229.                                                                  DeleteFile
  2230.  
  2231.           Function:    DeleteFile
  2232.  
  2233.           Purpose:     Deletes a file.
  2234.  
  2235.           Declaration: int DeleteFile(char *Filename);
  2236.  
  2237.           Returns:     The return value is "0" if no error occurs or the
  2238.                        DOS error code if an error occurs.  (See Appendix
  2239.                        "A", FILE FUNCTIONS, for more information).
  2240.  
  2241.           Parameters:
  2242.  
  2243.               Filename - char pointer to a valid filename.
  2244.  
  2245.           Example:
  2246.  
  2247.           #include <slc1.h>
  2248.  
  2249.           main()
  2250.              {
  2251.              int RetCode;
  2252.              RetCode=DeleteFile("c:\\bin\\file.1");
  2253.              /* Will delete file "FILE.1" stored in drive "C" and the
  2254.                 "BIN" directory.  Note the double backslashes between
  2255.                 the elements of the pathname. */
  2256.              }
  2257.  
  2258.  
  2259.  
  2260.  
  2261.  
  2262.  
  2263.  
  2264.  
  2265.  
  2266.  
  2267.  
  2268.  
  2269.  
  2270.  
  2271.  
  2272.  
  2273.  
  2274.  
  2275.  
  2276.  
  2277.  
  2278.  
  2279.                                       Page -34-
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.                           SCL1 Version 2.0 Reference Manual
  2286.  
  2287.  
  2288.                                                                   DialogBox
  2289.  
  2290.           Function:    DialogBox
  2291.  
  2292.           Purpose:     Displays a dialog box for keyboard input. The box
  2293.                        will be displayed at the screen's center.  The
  2294.                        function takes care or saving and restoring the
  2295.                        screen contents of the display area.  See the
  2296.                        GetString function for the editing features.
  2297.  
  2298.           Declaration: int DialogBox(int BoxColor, char *Prompt,
  2299.                            int InputColor, int MaxChar,
  2300.                            unsigned int CharType, char *Buffer);
  2301.  
  2302.           Returns:     The return value is the number of characters typed
  2303.                        or "-1" if Esc is pressed.
  2304.  
  2305.           Parameters:
  2306.  
  2307.               BoxColor - color attributes of the dialog box (integer).
  2308.  
  2309.                 Prompt - pointer to the dialog prompt (char).
  2310.  
  2311.             InputColor - color attributes of the input (integer).
  2312.  
  2313.                MaxChar - maximum number of characters to accept (integer).
  2314.  
  2315.               CharType - the type of characters to accept as defined in
  2316.                          SCL1.H (refer to the CheckChar function) (unsigned
  2317.                          integer).
  2318.  
  2319.                 Buffer - pointer to the buffer to be used to store the
  2320.                          information entered, it must be one digit larger
  2321.                          than the field size (for the string termination
  2322.                          null character).
  2323.  
  2324.           Example:
  2325.  
  2326.           #include <scl1.h>
  2327.           #include <scl1clor.h>
  2328.  
  2329.           int Color1=WHITE_BLACK+HIGHLIGHT;
  2330.           int Color2=BLACK_WHITE;
  2331.           char buffer[33]         /* buffer to hold input, one character
  2332.                                      larger than MaxChar */
  2333.           main()
  2334.              {
  2335.              DialogBox(Color1,"Filename",Color2,32,CC_FILESPEC,buffer);
  2336.              }
  2337.  
  2338.                                       Page -35-
  2339.  
  2340.  
  2341.  
  2342.  
  2343.  
  2344.                           SCL1 Version 2.0 Reference Manual
  2345.  
  2346.  
  2347.                                                                DisableMouse
  2348.  
  2349.           Function:    DisableMouse
  2350.  
  2351.           Purpose:     Removes interrupt service routine installed by
  2352.                        SetMouseIsr
  2353.  
  2354.           Declaration: void DisableMouse(void);
  2355.  
  2356.           Returns:     Nothing
  2357.  
  2358.           Parameters:  None
  2359.  
  2360.           Example:
  2361.  
  2362.           #include <scl1.h>
  2363.  
  2364.           main()
  2365.              {
  2366.              if(CheckMouse();
  2367.                 {
  2368.                 ResetMouse();
  2369.                 SetMouseIsr();
  2370.                 ShowMouse();
  2371.                 }
  2372.              .
  2373.              .
  2374.              .
  2375.              DisableMouse();
  2376.              }
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.  
  2385.  
  2386.  
  2387.  
  2388.  
  2389.  
  2390.  
  2391.  
  2392.  
  2393.  
  2394.  
  2395.  
  2396.  
  2397.                                       Page -36-
  2398.  
  2399.  
  2400.  
  2401.  
  2402.  
  2403.                           SCL1 Version 2.0 Reference Manual
  2404.  
  2405.  
  2406.                                                                 DrawBarMenu
  2407.  
  2408.           Function:    DrawBarMenu   (OBSOLETE, use the MenuSystem
  2409.                                      function, this function will
  2410.                                      eventually be removed from future
  2411.                                      versions of SCL1.)
  2412.  
  2413.           Purpose:     Draws a Bar Menu to the screen's top line.
  2414.  
  2415.           Declaration: void DrawBarMenu(int NormalColor,int SelectedColor,
  2416.                             int NumItems,int Selection,struct BarMenu* bm);
  2417.  
  2418.           Returns:     Nothing
  2419.  
  2420.           Parameters:
  2421.  
  2422.           The Menu information must be given as an array of structures as
  2423.           follows:
  2424.  
  2425.              struct BarMenu{
  2426.                 int StartCol,EndCol;
  2427.                 char String[20];
  2428.                 };
  2429.  
  2430.           where,
  2431.  
  2432.               StartCol - column position of the start of the prompt
  2433.                          (integer).
  2434.  
  2435.                 EndCol - column position of the end of the prompt
  2436.                          (integer).
  2437.  
  2438.                 String - char pointer to prompt.
  2439.  
  2440.           The parameters passed to the function are:
  2441.  
  2442.                 NColor - normal color attributes of menu (integer).
  2443.  
  2444.                 RColor - reversed color attributes of menu (integer).
  2445.  
  2446.               NumItems - number of menu items (integer).
  2447.  
  2448.              Selection - default selection (integer).
  2449.  
  2450.                BarMenu - pointer to a previously defined BarMenu structure.
  2451.  
  2452.  
  2453.  
  2454.  
  2455.  
  2456.                                       Page -37-
  2457.  
  2458.  
  2459.  
  2460.  
  2461.  
  2462.                           SCL1 Version 2.0 Reference Manual
  2463.  
  2464.  
  2465.                                                                 DrawBarMenu
  2466.  
  2467.           Example:
  2468.  
  2469.           #include <scl1.h>
  2470.           #include <scl1clor.h>
  2471.  
  2472.           /* Bar Menu structure */
  2473.  
  2474.           struct BarMenu bm[]={
  2475.              2,8,              /*Start and end of display*/
  2476.              "Option1",        /*Menu item information   */
  2477.              15,21,            /* Second menu option     */
  2478.              "Option2"};
  2479.  
  2480.           main()
  2481.              {
  2482.              int Selection=0;
  2483.  
  2484.              if(CheckMouse())
  2485.                 InitMouse(IM_SHOW);
  2486.              else
  2487.                 printf("No Mouse available\n");
  2488.              DrawBarMenu(BLACK_WHITE,WHITE_BLACK,2,Selection,bm);
  2489.              while(Selection==0)
  2490.                 {
  2491.                 if((Selection=CheckBarMenu(2,bm)))  /* Selection made? */
  2492.                    DrawBarMenu(BLACK_WHITE,WHITE_BLACK,2,Selection,bm);
  2493.                 }
  2494.              }
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.                                       Page -38-
  2516.  
  2517.  
  2518.  
  2519.  
  2520.  
  2521.                           SCL1 Version 2.0 Reference Manual
  2522.  
  2523.  
  2524.                                                                 DrawBoxLine
  2525.  
  2526.           Function:    DrawBoxLine
  2527.  
  2528.           Purpose:     Draws either vertical or horizontal lines inside a
  2529.                        box with the proper end line characters.
  2530.  
  2531.           Declaration: void DrawBoxLine(int Color,int FrameType,int Row1,
  2532.                             int Col1,int Row2,int Col2);
  2533.  
  2534.           Returns:     Nothing
  2535.  
  2536.           Parameters:
  2537.  
  2538.           The parameters passed to the function are:
  2539.  
  2540.                  Color - color attributes of the line to be drawn
  2541.                          (integer).
  2542.  
  2543.              FrameType - type of frame used to draw the box (integer).
  2544.  
  2545.                   Row1 - row position where the line starts (integer).
  2546.  
  2547.                   Col1 - column position where the line starts (integer).
  2548.  
  2549.                   Row2 - row position where the line ends (integer).
  2550.  
  2551.                   Col2 - column position where the line ends (integer).
  2552.  
  2553.              Note: To draw horizontal lines both Row1 and Row2 must have
  2554.                    the same value, for vertical lines both Col1 and Col2
  2555.                    must have the same value.
  2556.  
  2557.           Example:
  2558.  
  2559.           #include <scl1.h>
  2560.           #include <scl1clor.h>
  2561.  
  2562.           int Color1=WHITE_BLACK;
  2563.  
  2564.           main()
  2565.              {
  2566.              Box(Color1,0,0,0,24,79);         /* Full screen box */
  2567.              DrawBoxLine(Color1,0,5,0,5,79);  /* Horizontal line in row 5*/
  2568.              DrawBoxLine(Color1,0,5,39,24,39);/* Vertical line between rows
  2569.                                                  5 and 24 */
  2570.              }
  2571.  
  2572.           See also Box, GSSBox, DrawLine
  2573.  
  2574.                                       Page -39-
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.                           SCL1 Version 2.0 Reference Manual
  2581.  
  2582.  
  2583.                                                                DrawItemList
  2584.  
  2585.           Function:    DrawItemList
  2586.  
  2587.           Purpose:     Draws a list of items (strings) to the screen and
  2588.                        permits the user to browse through them.  The
  2589.                        selected item (>"0") is drawn in the color specified
  2590.                        with SelectedColor.
  2591.  
  2592.           Declaration: void DrawItemList(int NormalColor,
  2593.                             int SelectedColor, int Number, int Selection,
  2594.                             Struct ItemList *il);
  2595.  
  2596.           Returns:     Nothing
  2597.  
  2598.           Parameters:
  2599.  
  2600.           The ItemList information must be given as an array of structures
  2601.           as follows:
  2602.  
  2603.              struct ItemList{
  2604.                 int Row,Col;
  2605.                 char *String;
  2606.                 };
  2607.  
  2608.           where,
  2609.  
  2610.                       Row - row position of the item (integer).
  2611.  
  2612.                       Col - column position of the item (integer).
  2613.  
  2614.                    String - char pointer to item text.
  2615.  
  2616.           The parameters passed to the function are:
  2617.  
  2618.               NormalColor - color attributes for the normal display of
  2619.                             items (integer).
  2620.  
  2621.             SelectedColor - color attributes for the display of the
  2622.                             selected item (integer).
  2623.  
  2624.                    Number - number of items to be displayed (integer).
  2625.  
  2626.                 Selection - default selection to be displayed when entering
  2627.                             the function (integer).
  2628.  
  2629.                  ItemList - pointer to a previously defined ItemList
  2630.                             structure.
  2631.  
  2632.  
  2633.                                       Page -40-
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.                           SCL1 Version 2.0 Reference Manual
  2640.  
  2641.  
  2642.                                                                DrawItemList
  2643.  
  2644.           Example:
  2645.  
  2646.           #include <scl1.h>
  2647.           #include <scl1clor.h>
  2648.  
  2649.           struct ItemList il[]={
  2650.              10,10,"String 1",
  2651.              10,30,"String 2",
  2652.              10,50,"String 3",
  2653.              };
  2654.  
  2655.           main()
  2656.              {
  2657.              int Selection=0;
  2658.  
  2659.              Cls(WHITE_BLACK,CLS_ALL);
  2660.              if(CheckMouse())
  2661.                 InitMouse(IM_SHOW);
  2662.              else
  2663.                 printf("No Mouse available\n");
  2664.              DrawItemList(WHITE_BLACK,BLACK_WHITE,3,Selection,il);
  2665.              while(Selection==0)
  2666.                 {
  2667.                 if(Selection=CheckItemList(3,8,il))
  2668.                    DrawItemList(WHITE_BLACK,BLACK_WHITE,3,Selection,il);
  2669.                 }
  2670.              }
  2671.  
  2672.           NOTE: The ScrollWindow and ListWindow functions provide
  2673.                 alternatives to perform the same tasks.
  2674.  
  2675.  
  2676.  
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.                                       Page -41-
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.                           SCL1 Version 2.0 Reference Manual
  2699.  
  2700.  
  2701.                                                                    DrawLine
  2702.  
  2703.           Function:    DrawLine
  2704.  
  2705.           Purpose:     Draws either vertical or horizontal lines.
  2706.  
  2707.           Declaration: void DrawLine(int Color, int Row, int Col,
  2708.                             int Count, int Direction, int Character);
  2709.  
  2710.           Returns:     Nothing
  2711.  
  2712.           Parameters:
  2713.  
  2714.           The parameters passed to the function are:
  2715.  
  2716.                  Color - color attributes of the line to be drawn
  2717.                          (integer).
  2718.  
  2719.                    Row - row position where the line starts (integer).
  2720.  
  2721.                    Col - column position where the line starts (integer).
  2722.  
  2723.                  Count - number of line characters to be drawn (integer).
  2724.  
  2725.              Direction - direction to draw. Variables DL_HORIZONTAL and
  2726.                          DL_VERTICAL has been defined in SCL1.H.
  2727.  
  2728.              Character - graphic character to use for line drawing
  2729.                          (integer).
  2730.  
  2731.           Example:
  2732.  
  2733.           #include <scl1.h>
  2734.           #include <scl1clor.h>
  2735.  
  2736.           int Color1=WHITE_BLACK;
  2737.  
  2738.           main()
  2739.              {
  2740.              DrawLine(Color1,5,5,10,DL_HORIZONTAL,196);
  2741.              /* Horizontal line in row 5, between columns 5 and 15 */
  2742.  
  2743.              DrawLine(Color1,5,5,14,DL_VERTICAL,179);
  2744.              /* Vertical line between rows 5 and 19, column 5 */
  2745.              }
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.                                       Page -42-
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.                           SCL1 Version 2.0 Reference Manual
  2758.  
  2759.  
  2760.                                                             DrawMouseButton
  2761.  
  2762.           Function:    DrawMouseButton
  2763.  
  2764.           Purpose:     Draws one or more mouse buttons to the screen. The
  2765.                        selected button is drawn in the specified color with
  2766.                        a double line box.  A mouse button consists of a
  2767.                        text prompt inside a box.  By clicking the mouse
  2768.                        after pointing to the button you can select it.
  2769.  
  2770.           Declaration: void DrawMouseButton(int NormalColor,
  2771.                             int SelectedColor,int Number,
  2772.                             int Selection,struct MouseButton *p);
  2773.  
  2774.           Returns:     Nothing.
  2775.  
  2776.           Parameters:
  2777.  
  2778.           The MouseButton information must be given as an array of
  2779.           structures as follows:
  2780.  
  2781.              struct MouseButton{
  2782.                 int Top,Left,Bottom,Right;
  2783.                 int Row,Col;
  2784.                 char String[20];
  2785.                 };
  2786.  
  2787.           where,
  2788.  
  2789.                    Top - upper row coordinate of the Mouse Button area
  2790.                          (integer).
  2791.  
  2792.                   Left - left column coordinate of the Mouse Button area
  2793.                          (integer).
  2794.  
  2795.                 Bottom - lower row coordinate of the Mouse Button area
  2796.                          (integer).
  2797.  
  2798.                  Right - right column coordinate of the Mouse Button area
  2799.                          (integer).
  2800.  
  2801.                    Row - row coordinate of the Mouse Button text (integer).
  2802.  
  2803.                    Col - column coordinate of the Mouse Button text
  2804.                          (integer).
  2805.  
  2806.                 String - the Mouse Button text (maximum of 19 characters.).
  2807.  
  2808.  
  2809.  
  2810.                                       Page -43-
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.                           SCL1 Version 2.0 Reference Manual
  2817.  
  2818.  
  2819.                                                             DrawMouseButton
  2820.  
  2821.           The parameters passed to the function are:
  2822.  
  2823.               NormalColor - color attribute used when button is not
  2824.                             selected (integer).
  2825.  
  2826.             SelectedColor - Color used for a selected button (integer).
  2827.  
  2828.                    Number - Number of buttons in the structure (integer).
  2829.  
  2830.                 Selection - Number of the selected button (0 for none)
  2831.                             (integer).
  2832.  
  2833.               MouseButton - pointer to predefined structure.
  2834.  
  2835.           Examples:
  2836.  
  2837.           #include <scl1.h>
  2838.           #include <scl1clor.h>
  2839.  
  2840.           int Color1=WHITE_BLACK;
  2841.           int Color2=BLACK_WHITE;
  2842.  
  2843.           struct MouseButton mb[]={
  2844.              4,35,6,45,   /* Box coordinates */
  2845.              5,38,        /* String position */
  2846.              "Yes",       /* String */
  2847.  
  2848.              10,35,12,45,
  2849.              11,39,
  2850.              "No",
  2851.              };
  2852.  
  2853.           main()
  2854.              {
  2855.              DrawMouseButton(Color1,Color2,2,1,mb);
  2856.              }
  2857.  
  2858.           NOTE: The Dialogue type MouseButton function provides a more
  2859.                 flexible way to perform the same task.
  2860.  
  2861.           See also CheckMouseButton.
  2862.  
  2863.  
  2864.  
  2865.  
  2866.  
  2867.  
  2868.  
  2869.                                       Page -44-
  2870.  
  2871.  
  2872.  
  2873.  
  2874.  
  2875.                           SCL1 Version 2.0 Reference Manual
  2876.  
  2877.  
  2878.                                                                    ErrorBox
  2879.  
  2880.           Function:    ErrorBox
  2881.  
  2882.           Purpose:     Displays a box, centered in the screen, with an
  2883.                        error message.  Several standard error messages have
  2884.                        been defined in the ErrorBox function.  You can add
  2885.                        your own error messages or modify the standard
  2886.                        errors by using the InitUserError function. You can
  2887.                        define the color attributes and a shadow effect for
  2888.                        the error boxes using the ErrorShadowOff,
  2889.                        ErrorShadowOn and SetErrorBoxColor functions.
  2890.  
  2891.           Declaration: void ErrorBox(int ErrNum);
  2892.  
  2893.           Returns:     Nothing.
  2894.  
  2895.           Parameters:
  2896.  
  2897.                 ErrNum - error number corresponding to the error message to
  2898.                          be displayed (integer).
  2899.  
  2900.           The error numbers defined are:
  2901.  
  2902.                        ERROR            DESCRIPTION
  2903.  
  2904.                           2             File not found
  2905.                           3             Path not found
  2906.                           4             Not enough handles
  2907.                           5             Access denied
  2908.                           6             Invalid handle
  2909.                           7             Memory control blocks destroyed
  2910.                           8             Insufficient memory
  2911.                           9             Invalid memory block address
  2912.                          10             Invalid environment
  2913.                          15             Invalid drive
  2914.                          18             No files found
  2915.                          27             Sector not found
  2916.                          29             Write Error
  2917.                          30             Read Error
  2918.                         255             File too Big
  2919.                          -1             DOS Critical Error
  2920.  
  2921.  
  2922.  
  2923.  
  2924.  
  2925.  
  2926.  
  2927.  
  2928.                                       Page -45-
  2929.  
  2930.  
  2931.  
  2932.  
  2933.  
  2934.                           SCL1 Version 2.0 Reference Manual
  2935.  
  2936.  
  2937.                                                                    ErrorBox
  2938.  
  2939.           Example:
  2940.  
  2941.           #include <scl1.h>
  2942.  
  2943.           struct ErrorMess em[]={
  2944.              256,"Please type either Y for YES\nor N for NO",
  2945.              0};
  2946.  
  2947.           main()
  2948.              {
  2949.              int Key;
  2950.  
  2951.              InitUserError(em);
  2952.              printf("\nInstall printer driver? (Y/N)\n");
  2953.  
  2954.              do
  2955.                 {
  2956.                 Key=toupper(getch());
  2957.                 if(Key != 'Y' && Key != 'N')
  2958.                    ErrorBox(256);
  2959.                 else
  2960.                    break;
  2961.                 }while(1);
  2962.              }
  2963.  
  2964.           See ErrorShadowOff, ErrorShadowOn, SetErrorBoxColor and
  2965.           InitUserError.
  2966.  
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.  
  2978.  
  2979.  
  2980.  
  2981.  
  2982.  
  2983.  
  2984.  
  2985.  
  2986.  
  2987.                                       Page -46-
  2988.  
  2989.  
  2990.  
  2991.  
  2992.  
  2993.                           SCL1 Version 2.0 Reference Manual
  2994.  
  2995.  
  2996.                                                              ErrorShadowOff
  2997.                                                               ErrorShadowOn
  2998.  
  2999.           Function:    ErrorShadowOff
  3000.                        ErrorShadowOn
  3001.  
  3002.           Purpose:     Enables or disables a shadow effect when using the
  3003.                        ErrorBox function.  All subsequent calls to the
  3004.                        ErrorBox function will be displayed with (or
  3005.                        without) a shadow effect.
  3006.  
  3007.           Declaration: void ErrorShadowOff(void);
  3008.                        void ErrorShadowOn(void);
  3009.  
  3010.           Returns:     Nothing.
  3011.  
  3012.           Parameters:  None.
  3013.  
  3014.           Example:
  3015.  
  3016.           #include <scl1.h>
  3017.  
  3018.           main
  3019.              {
  3020.              ErrorShadowOn();  /* Turn on shadow effect on error boxes  */
  3021.              .
  3022.              .
  3023.              .
  3024.              ErrorShadowOff(); /* Turn off shadow effect on error boxes */
  3025.              }
  3026.  
  3027.           See ErrorBox, InitUserError and SetErrorBoxColor.
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.  
  3044.  
  3045.  
  3046.                                       Page -47-
  3047.  
  3048.  
  3049.  
  3050.  
  3051.  
  3052.                           SCL1 Version 2.0 Reference Manual
  3053.  
  3054.  
  3055.                                                                  FieldCheck
  3056.  
  3057.           Function:    FieldCheck
  3058.  
  3059.           Purpose:     This function is designed to be used with the
  3060.                        Fields2 function.  When using Fields2 you must
  3061.                        specify a function (in the FData1 structure) to
  3062.                        handle events.  It receives messages from Fields2
  3063.                        and must act upon them returning messages telling
  3064.                        wether the cursor should move to the next/previous
  3065.                        field, stay at the same position or exit the
  3066.                        function.  This function can, at the same time,
  3067.                        monitor the data that is being entered and display
  3068.                        help or error messages, if necessary.  The
  3069.                        FieldCheck function has been designed to handle the
  3070.                        most typical events that are likely to occur when
  3071.                        using Fields2:
  3072.  
  3073.                             TAB - Moves the cursor to the next field.
  3074.  
  3075.                       SHIFT+TAB - Moves the cursor to the previous field.
  3076.  
  3077.                             ESC - Exit Fields2.
  3078.  
  3079.                           ENTER - Its action depends on the active field
  3080.                                   type.  When LineEditor, TagItem or Select
  3081.                                   are active, pressing ENTER moves control
  3082.                                   to the next field.  When ScrollWindow or
  3083.                                   ListWindow are active, pressing ENTER
  3084.                                   will selects the highlighted item.  When
  3085.                                   MouseButton is active, it works as an
  3086.                                   exit key.
  3087.  
  3088.                    MOUSE EVENTS - Handles all mouse events.
  3089.  
  3090.                        It is recommended that you always use FieldCheck. 
  3091.                        Even if you need to define your own field checking
  3092.                        function for data validation or other purposes, you
  3093.                        can still call FieldCheck from your function so that
  3094.                        you don't need to care about the handling the events
  3095.                        just mentioned.
  3096.  
  3097.  
  3098.           Declaration: int FieldCheck(FData2 *p);
  3099.  
  3100.           Returns:     The return value is a message.  Please refer to the
  3101.                        Fields2 function for details.
  3102.  
  3103.  
  3104.  
  3105.                                       Page -48-
  3106.  
  3107.  
  3108.  
  3109.  
  3110.  
  3111.                           SCL1 Version 2.0 Reference Manual
  3112.  
  3113.  
  3114.                                                                  FieldCheck
  3115.  
  3116.           Parameters:
  3117.  
  3118.                 The required parameter is a pointer to the FData2 structure
  3119.                 of the field to be checked.
  3120.  
  3121.           Example:
  3122.  
  3123.              See the example of the Fields2 function.
  3124.  
  3125.  
  3126.  
  3127.  
  3128.  
  3129.  
  3130.  
  3131.  
  3132.  
  3133.  
  3134.  
  3135.  
  3136.  
  3137.  
  3138.  
  3139.  
  3140.  
  3141.  
  3142.  
  3143.  
  3144.  
  3145.  
  3146.  
  3147.  
  3148.  
  3149.  
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.                                       Page -49-
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.                           SCL1 Version 2.0 Reference Manual
  3171.  
  3172.  
  3173.                                                                      Fields
  3174.  
  3175.           Function:    Fields
  3176.  
  3177.           Purpose:     Get keyboard input using fields.  With this function
  3178.                        you can make data entry screens very easily.  You
  3179.                        can move across the fields using the TAB, SHIFTTAB
  3180.                        keys or the mouse.  The exit key is defined when
  3181.                        calling the function.  You have the capability of
  3182.                        calling a data validation function after finishing
  3183.                        editing each field.  You can also call a help
  3184.                        function associated with each field, this permits
  3185.                        context sensitive help.  When you reach the maximum
  3186.                        field length, as defined by the MaxChar parameter,
  3187.                        the cursor jumps to the next field, thus for special
  3188.                        field types, such as date fields, you can define
  3189.                        three separate data entry fields for the month, day
  3190.                        and year and make them look as one field.
  3191.  
  3192.           Declaration: int Fields(int NColor, int RColor, int NFields,
  3193.                            struct InputFields *ifld, unsigned int ExitKey,
  3194.                            unsigned int HelpKey);
  3195.  
  3196.           Returns:     The returned value is "1" if a key defined as an
  3197.                        exit key is pressed and "-1" if the ESC key is
  3198.                        pressed.
  3199.  
  3200.           Parameters:
  3201.  
  3202.           The field information must be given in a structure as follows:
  3203.  
  3204.           struct InputFields{
  3205.              int PromptLine;
  3206.              int PromptCol;
  3207.              char *Prompt;
  3208.              int FieldLine;
  3209.              int FieldCol;
  3210.              char *FieldBuffer;
  3211.              int MaxChar;
  3212.              int CharType;
  3213.              int (* Helpf)(struct InputFields *p);
  3214.              int (* CheckF)(struct InputFields *p);
  3215.              };
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.                                       Page -50-
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.                           SCL1 Version 2.0 Reference Manual
  3230.  
  3231.  
  3232.                                                                      Fields
  3233.  
  3234.           Where;
  3235.  
  3236.            InputFields - the structure tag.
  3237.  
  3238.             Promptline - row position where to display the prompt
  3239.                          (integer).
  3240.  
  3241.              PromptCol - column position where to display the prompt
  3242.                          (integer).
  3243.  
  3244.                 Prompt - pointer to the field prompt to be displayed
  3245.                          (char).
  3246.  
  3247.              FieldLine - row position where to display the field (integer).
  3248.  
  3249.               FieldCol - Column position where to display the field
  3250.                          (integer).
  3251.  
  3252.            FieldBuffer - pointer to the buffer to be used to store the
  3253.                          field, it must be one digit larger than the field
  3254.                          size to include the string termination null
  3255.                          character (char).
  3256.  
  3257.                MaxChar - length of the input field (integer).
  3258.  
  3259.               CharType - the mask of valid characters as described in
  3260.                          function CheckChar (integer).
  3261.  
  3262.                  Helpf - pointer to a help function.  This function
  3263.                          receives a pointer to the fields structure and
  3264.                          must be user supplied since it is not defined in
  3265.                          SCL1.H.
  3266.  
  3267.                 CheckF - pointer to a field validation function.  This
  3268.                          function receives a pointer to the fields
  3269.                          structure and must be user supplied since it is
  3270.                          not defined in SCL1.H.  The CheckF must return a
  3271.                          value of "0" if the field fails the test or a
  3272.                          value of "1" to accept the entry.
  3273.  
  3274.  
  3275.  
  3276.  
  3277.  
  3278.  
  3279.  
  3280.  
  3281.  
  3282.                                       Page -51-
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.                           SCL1 Version 2.0 Reference Manual
  3289.  
  3290.  
  3291.                                                                      Fields
  3292.  
  3293.           The parameters required are:
  3294.  
  3295.                 NColor - color attributes for the prompt display (integer).
  3296.  
  3297.                 RColor - color attributes for the field display (integer).
  3298.  
  3299.                NFields - number of fields (integer).
  3300.  
  3301.            InputFields - pointer to the InputFields structure.
  3302.  
  3303.                ExitKey - key to be used to exit the fields screen (unsigned
  3304.                          integer).
  3305.  
  3306.                HelpKey - key to be used for calling the help function
  3307.                          (unsigned integer).
  3308.  
  3309.  
  3310.           Example:
  3311.  
  3312.           #include <scl1.h>
  3313.           #include <scl1keys.h>
  3314.           #include <scl1clor.h>
  3315.  
  3316.           int test(struct InputFields *p);
  3317.           int helpf(struct InputFields *p);
  3318.  
  3319.           char buffer1[29];
  3320.           char buffer2[29];
  3321.           char buffer3[29];
  3322.           char buffer4[29];
  3323.           char buffer5[13];
  3324.           char buffer6[11];
  3325.           char buffer7[11];
  3326.           char buffer8[11];
  3327.           char buffer9[9];
  3328.           char buffer10[11];
  3329.  
  3330.  
  3331.  
  3332.  
  3333.  
  3334.  
  3335.  
  3336.  
  3337.  
  3338.  
  3339.  
  3340.  
  3341.                                       Page -52-
  3342.  
  3343.  
  3344.  
  3345.  
  3346.  
  3347.                           SCL1 Version 2.0 Reference Manual
  3348.  
  3349.  
  3350.                                                                      Fields
  3351.  
  3352.           struct InputFields data[]={
  3353.              4,3,"Name:",4,11,buffer1,28,CC_LETTER | CC_PUNCTUATION |
  3354.                     CC_CAPITALIZE,helpf,test,
  3355.              6,3,"Address:",6,11,buffer2,28,CC_ANY |
  3356.                     CC_CAPITALIZE,helpf,test,
  3357.              8,3,"City:",8,11,buffer3,28,CC_ANY | CC_CAPITALIZE,helpf,test,
  3358.              10,3,"State:",10,11,buffer4,28,CC_LETTER | CC_PUNCTUATION |
  3359.                    CC_CAPITALIZE,helpf,test,
  3360.              12,3,"Zip:",12,11,buffer5,12,CC_DIGIT,helpf,test,
  3361.              4,44,"Customer Number:",4,60,buffer6,10,CC_DIGIT,helpf,test,
  3362.              6,44,"Amount Due:   $",6,60,buffer7,10,CC_REAL,helpf,test,
  3363.              8,44,"Credit Limit: $",8,60,buffer8,10,CC_REAL,helpf,test,
  3364.              10,44,"Date:",10,49,buffer9,8,CC_ANY,helpf,test,
  3365.              12,44,"Transaction Number:",12,64,buffer10,10,CC_REAL,helpf,
  3366.                    test};
  3367.  
  3368.           main()
  3369.              {
  3370.              Cls(WHITE_BLACK,CLS_ALL);
  3371.              Fields(WHITE_BLACK,BLACK_WHITE,10,data,F10,F1);
  3372.              }
  3373.  
  3374.           helpf(struct InputFields *p)
  3375.           {
  3376.           PushCursor();
  3377.           CursorOff();
  3378.           MessageOn(BLACK_WHITE,"This function would\ndisplay your help
  3379.                     screens.");
  3380.           WaitTime(200);
  3381.           MessageOff();
  3382.           PopCursor();
  3383.           }
  3384.  
  3385.           test(struct InputFields *p)
  3386.           {
  3387.           PushCursor();
  3388.           CursorOff();
  3389.           MessageOn(BLACK_WHITE,"This function could perform\ndata
  3390.                     validation each time\nthe cursor moves to a new
  3391.                     field\nor the user chosses to exit.");
  3392.           WaitTime(300);
  3393.           MessageOff();
  3394.           PopCursor();
  3395.           return(1);
  3396.           }
  3397.           NOTE: The Fields2 function provides a more flexible way to
  3398.                 perform the same task.
  3399.  
  3400.                                       Page -53-
  3401.  
  3402.  
  3403.  
  3404.  
  3405.  
  3406.                           SCL1 Version 2.0 Reference Manual
  3407.  
  3408.  
  3409.                                                                     Fields2
  3410.  
  3411.           Function:    Fields2
  3412.  
  3413.           Purpose:     This function lets you integrate various dialog type
  3414.                        functions to design very powerful data entry and
  3415.                        dialog screens.  This function is similar to Fields
  3416.                        but is more flexible.  Every field can have its
  3417.                        unique help and validation function which you can
  3418.                        create and customize to provide a very useful user
  3419.                        interface.  The screens can contain any of the
  3420.                        following fields:
  3421.  
  3422.                           Line Editor - a field to enter and edit text and
  3423.                                         numeric data.
  3424.  
  3425.                         Scroll Window - a field that displays a window with
  3426.                                         a partial list of items and permits
  3427.                                         tagging or selecting one of them.
  3428.  
  3429.                          Mouse Button - a field that consists of a single
  3430.                                         prompt and permits either to ignore
  3431.                                         it or activate it.
  3432.  
  3433.                              Tag Item - a field that permits to tag one or
  3434.                                         various options.
  3435.  
  3436.                                Select - a field with multiple items that
  3437.                                         permits user selection.
  3438.  
  3439.                           List Window - a field similar to the Scroll
  3440.                                         Window but permits multiple items
  3441.                                         in each line.
  3442.  
  3443.                              Calendar - a field that displays a calendar of
  3444.                                         a given date and permits the user
  3445.                                         to modify the date.
  3446.  
  3447.                          User Defined - a field defined by the user.
  3448.  
  3449.           Declaration: FData2 *Fields2(int Message,FData1 *fd1,
  3450.                                FData2 *fd2);
  3451.  
  3452.           Returns:     This function integrates various dialog type
  3453.                        functions.  See Appendix "E" for a description of
  3454.                        the general operation of these functions. The
  3455.                        returned value is a pointer to the FData2 structure.
  3456.  
  3457.  
  3458.  
  3459.                                       Page -54-
  3460.  
  3461.  
  3462.  
  3463.  
  3464.  
  3465.                           SCL1 Version 2.0 Reference Manual
  3466.  
  3467.  
  3468.                                                                     Fields2
  3469.  
  3470.           Parameters:
  3471.  
  3472.           The field information is given as an array of structures type
  3473.           FData1 as follows, one structure element for each field:
  3474.  
  3475.           Type FData1 structure:
  3476.  
  3477.           typedef struct{
  3478.              int FieldType;
  3479.              void *Structure1;
  3480.              void *Structure2;
  3481.              int (* CheckF)();
  3482.              }FData1;
  3483.  
  3484.           where,
  3485.  
  3486.              FieldType - an integer structure element containing the type
  3487.                          of function for each field defined as follows:
  3488.  
  3489.                          LINE_EDITOR
  3490.                          SCROLL_WINDOW
  3491.                          MOUSE_BUTTON
  3492.                          TAG_ITEM
  3493.                          SELECT
  3494.                          LIST_WINDOW
  3495.                          CALENDAR
  3496.                          USER DEFINED
  3497.  
  3498.             Structure1 - pointer to a structure that contains all the
  3499.                          information required for the field.
  3500.  
  3501.             Structure2 - pointer to a second structure that contains the
  3502.                          field information.  Use "0" if the field type does
  3503.                          not require a second structure.
  3504.  
  3505.                 CheckF - pointer to a function that will be called every
  3506.                          time an event occurs. This function is responsible
  3507.                          for the program flow.  It constantly receives
  3508.                          messages from Fields2 and returns messages to
  3509.                          Fields2 telling it what should be done.  This
  3510.                          allows you to have complete control of the
  3511.                          behavior of Fields2, as well as to perform complex
  3512.                          data validation, context-sensitive help, etc. SCL1
  3513.                          includes a default CheckF called FieldCheck, you
  3514.                          should use this function even if you create your
  3515.                          own CheckF. Please refer to FieldCheck for more
  3516.                          information.
  3517.  
  3518.                                       Page -55-
  3519.  
  3520.  
  3521.  
  3522.  
  3523.  
  3524.                           SCL1 Version 2.0 Reference Manual
  3525.  
  3526.  
  3527.                                                                     Fields2
  3528.  
  3529.              Fields2 needs a secondary structure FData2.  This structure is
  3530.              used for communication between Fields2, the CheckF and the
  3531.              calling program. Each time an event occurs the CheckF is
  3532.              called. By reading the FData2 Message element, the CheckF
  3533.              knows what has just happened. For example, the user could have
  3534.              pressed the TAB key to move to the next field, or he may have
  3535.              clicked the mouse while pointing at another field, or he may
  3536.              have just type a character. CheckF is responsible of telling
  3537.              Fields2 what should be done.
  3538.  
  3539.           Type FData2 structure:
  3540.  
  3541.           typedef struct{
  3542.              int Message;
  3543.              unsigned int EventInfo;
  3544.              FData1 *Structure;
  3545.              int ActiveField;
  3546.              int FieldsNumber;
  3547.              }FData2;
  3548.  
  3549.           where,
  3550.  
  3551.                Message - the message that is transferred between one field
  3552.                          and another (integer).
  3553.  
  3554.              EventInfo - information about the keys that have been pressed
  3555.                          (unsigned integer).
  3556.  
  3557.                 FData1 - pointer to the FData1 structure.
  3558.  
  3559.            ActiveField - structure element that keeps a record of the
  3560.                          current field.  An integer value starting with "0"
  3561.                          for the first field.  This structure element is
  3562.                          used internally by the function (integer).
  3563.  
  3564.           FieldsNumber - structure element that holds the number of fields,
  3565.                          used internally by the function (integer).
  3566.  
  3567.  
  3568.           Type structure FData3:
  3569.  
  3570.           typedef struct{
  3571.              int EventInfo;
  3572.              int (* CheckF)();
  3573.              }FData3;
  3574.  
  3575.  
  3576.  
  3577.                                       Page -56-
  3578.  
  3579.  
  3580.  
  3581.  
  3582.  
  3583.                           SCL1 Version 2.0 Reference Manual
  3584.  
  3585.  
  3586.                                                                     Fields2
  3587.  
  3588.           where,
  3589.  
  3590.                 EventInfo - information about the last illegal or exit key
  3591.                             that has been pressed (unsigned integer).
  3592.  
  3593.                    CheckF - pointer to check function (integer).
  3594.  
  3595.           NOTE: The information stored in structure type FData3 is used to
  3596.                 define the parameters for user defined fields, in most
  3597.                 applications you can disregard it.
  3598.  
  3599.           Messages:
  3600.  
  3601.           The messages that can be sent to the Fields2 function are:
  3602.  
  3603.                    F_INIT - initialize the Fields2 structures to NULL.
  3604.  
  3605.                    F_DRAW - draw the Fields2 screen.
  3606.  
  3607.                  F_ACTIVE - edit the Fields2 information.
  3608.  
  3609.           When the CheckF is called, after determining what should be done,
  3610.           it can send one the following messages back to Fields2:
  3611.  
  3612.             F_MOUSE_EVENT - internal message used to keep track of where
  3613.                             the mouse has been clicked.
  3614.  
  3615.           F_POSITION_STAY - this message instructs Fields2 not to move to
  3616.                             any other field.  This message is useful when a
  3617.                             validation function has been called and the
  3618.                             field does not pass the validation check, to
  3619.                             permit the user to edit its contents.
  3620.  
  3621.             F_POSITION_UP - move to the next field.
  3622.  
  3623.           F_POSITION_DOWN - move to the previous field.
  3624.  
  3625.            F_SET_POSITION - this message is used to move the cursor to a
  3626.                             desired field. You must first set the
  3627.                             ActiveField structure member to the desired
  3628.                             field number and then return this message.
  3629.  
  3630.                    F_EXIT - instructs Fields2 to exit.
  3631.  
  3632.            F_SET_POS_EXIT - exit after setting a predetermined position.
  3633.  
  3634.  
  3635.  
  3636.                                       Page -57-
  3637.  
  3638.  
  3639.  
  3640.  
  3641.  
  3642.                           SCL1 Version 2.0 Reference Manual
  3643.  
  3644.  
  3645.                                                                     Fields2
  3646.  
  3647.                 F_DRAW_NR - draw the Fields2 display and do not reset the
  3648.                             field values.  When using the F_DRAW message,
  3649.                             Fields2 resets all the fields to their starting
  3650.                             position.
  3651.  
  3652.              F_CHECK_ALL -  when a CheckF senses that the user wants to
  3653.                             exit, it can send this message to Fields2.
  3654.                             Fields2 will call each CheckF defined for each
  3655.                             field. This is very useful if you have a data
  3656.                             validation CheckF for each field. By returning
  3657.                             this message you can be sure that the data in
  3658.                             each field is valid since Fields2 will move to
  3659.                             any field that do not pass the CheckF
  3660.                             validation. If all Fields are valid this
  3661.                             message will behave like an F_EXIT message.
  3662.  
  3663.                 F_COLORS -  all Dialog functions get the color values from
  3664.                             their structures. If you have initialized these
  3665.                             structures as static data and you need to
  3666.                             change the color values you can send this
  3667.                             message to Fields2.  It will change the colors
  3668.                             in each structure to those specified as
  3669.                             additional parameters.  The first value passed
  3670.                             is the Normal Color and the second is the
  3671.                             Reversed Color.
  3672.  
  3673.           Due to the function integrating purpose of Fields2, it does not
  3674.           return messages.
  3675.  
  3676.  
  3677.           Example:
  3678.  
  3679.           #include <scl1.h>
  3680.           #include <scl1keys.h>
  3681.           #include <scl1clor.h>
  3682.  
  3683.           int OurFieldCheck(FData2 *fd2);   /* our CheckF prototype */
  3684.  
  3685.           /* Colors are initialized for a color monitor */
  3686.           int Color1=WHITE_BLUE;
  3687.           int Color2=BLACK_CYAN;
  3688.           int Color3=BROWN_BLACK+HIGHLIGHT;
  3689.  
  3690.  
  3691.  
  3692.  
  3693.  
  3694.  
  3695.                                       Page -58-
  3696.  
  3697.  
  3698.  
  3699.  
  3700.  
  3701.                           SCL1 Version 2.0 Reference Manual
  3702.  
  3703.  
  3704.                                                                     Fields2
  3705.  
  3706.           /* Our first field will be a Select type */
  3707.  
  3708.           SData1 sd1[]={       /* This is Select's first structure */
  3709.                11,37,"YES",
  3710.                11,47,"NO",
  3711.                0};
  3712.  
  3713.           /* Select's secondary structure: */
  3714.           SData2 sd2={23,11,16,"Create backup files:",0,0,0,0};
  3715.  
  3716.           char buffer[31];   /* Buffer for the data-entry field */
  3717.  
  3718.           /* Our second field will be a LineEditor type */
  3719.           /* This structure defined the LineEditor parameters */
  3720.           LEData led={23,13,16,"Backup Directory:",112,13,34,30,30,
  3721.              CC_PATH+CC_CAPITALIZE, 0,0,buffer,0,0,0,2,1,0,0,0,0,0,0,0};
  3722.  
  3723.           /* The next two fields will of the MouseButton type */
  3724.           /* We must define two structures for the MouseButtons */
  3725.           MBData mb1={23,112,15,28,15,33,15,28,"≡ OK ≡",0,0,0,0};
  3726.  
  3727.           MBData mb2={23,112,15,42,15,51,15,42,"≡ CANCEL ≡",0,0,0,0};
  3728.  
  3729.           /* This is the FData1 structure: */
  3730.           FData1 fd1[]={
  3731.                SELECT,sd1,&sd2,OurFieldCheck,
  3732.                LINE_EDITOR,&led,0,OurFieldCheck,
  3733.                MOUSE_BUTTON,&mb1,0,OurFieldCheck,
  3734.                MOUSE_BUTTON,&mb2,0,OurFieldCheck,
  3735.                0};
  3736.  
  3737.  
  3738.           main()
  3739.           {
  3740.           FData2 fd2; /* Fields2 secondary structure */
  3741.  
  3742.           /* Verify the type of display and change colors if neccessary */
  3743.           if(Video()==MONO)
  3744.               {
  3745.               Color1=WHITE_BLACK;
  3746.               Color2=BLACK_WHITE;
  3747.               Color3=BLACK_WHITE+HIGHLIGHT;
  3748.               }
  3749.  
  3750.  
  3751.  
  3752.  
  3753.  
  3754.                                       Page -59-
  3755.  
  3756.  
  3757.  
  3758.  
  3759.  
  3760.                           SCL1 Version 2.0 Reference Manual
  3761.  
  3762.  
  3763.                                                                     Fields2
  3764.  
  3765.           /* Clear the screen and draw a box */
  3766.           Cls(Color1,10,13,16,66);
  3767.           Box(Color1,0,10,13,16,66);
  3768.  
  3769.           /* Call Fields2 with a F_INIT message */
  3770.           Fields2(F_INIT,fd1,&fd2);
  3771.  
  3772.           /* Tell Fields2 to modify colors to new values */
  3773.           Fields2(F_COLORS,fd1,&fd2,Color1,Color2);
  3774.  
  3775.           /* Draw fields */
  3776.           Fields2(F_DRAW,fd1,&fd2);
  3777.  
  3778.           /* Activate, now our CheckF will be in control of program flow */
  3779.           Fields2(F_ACTIVE,fd1,&fd2);
  3780.  
  3781.           /* Check the FData2 structure to see if the user presses ESCAPE
  3782.              or selects the CANCEL mouse button for exiting */
  3783.  
  3784.           if(fd2.ActiveField==3 || fd2.EventInfo==ESC)
  3785.               exit(-1);   /* CANCEL selected */
  3786.           else
  3787.               exit(0);    /* OK selected */
  3788.           }
  3789.  
  3790.  
  3791.           /* This is the custom field check function */
  3792.           int OurFieldCheck(FData2 *fd2)
  3793.           {
  3794.           int Mess;
  3795.  
  3796.           /* Let SCL1 FieldCheck function do most of the work */
  3797.           Mess=FieldCheck(fd2);
  3798.  
  3799.           /* Our only job is to watch for the F1 help key. It will be
  3800.              reported by Fields2 with an ILLEGAL_KEY message in the FData2
  3801.              structure element.  The message and the key value will be
  3802.              stored in the EventInfo element */
  3803.  
  3804.           if(fd2->Message == LE_ILLEGAL_KEY && fd2->EventInfo==F1)
  3805.               {
  3806.  
  3807.           /* F1 key pressed, save cursor status and turn it off */
  3808.               PushCursor();
  3809.               CursorOff();
  3810.  
  3811.  
  3812.  
  3813.                                       Page -60-
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.                           SCL1 Version 2.0 Reference Manual
  3820.  
  3821.  
  3822.                                                                     Fields2
  3823.  
  3824.           /* fd2->ActiveField tells us the field number that is active,
  3825.              we will use it to display context sensitive help */
  3826.  
  3827.               switch(fd2->ActiveField)
  3828.                   {
  3829.                   case 0: /* first field */
  3830.                       MessageOn(Color3,"Use arrow keys to select if you\n
  3831.                                         want to create backup files.");
  3832.                       break;
  3833.  
  3834.                   case 1: /* second field */
  3835.                       MessageOn(Color3,"Type Backup files directory.");
  3836.                       break;
  3837.  
  3838.                   case 2: /* third field */
  3839.                       MessageOn(Color3,"Press ENTER to validate\n
  3840.                                         your selection.");
  3841.                       break;
  3842.  
  3843.                   case 3: /* fourth field */
  3844.                       MessageOn(Color3,"Press ENTER or ESC to\n
  3845.                                         cancel your selection.");
  3846.                       break;
  3847.                   }
  3848.               Mess=F_POSITION_STAY;  /* return the position stay message so
  3849.                                         that the cursor does not move */
  3850.               WaitKeyMouse();        /* wait for a key */
  3851.               MessageOff();          /* restore screen */
  3852.               PopCursor();           /* restore cursor */
  3853.               }
  3854.           return(Mess);  /* Mess holds the message Fields2 will receive, a
  3855.                             POSITION_STAY message or the message returned
  3856.                             by FieldCheck */
  3857.           }
  3858.  
  3859.  
  3860.  
  3861.  
  3862.  
  3863.  
  3864.  
  3865.  
  3866.  
  3867.  
  3868.  
  3869.  
  3870.  
  3871.  
  3872.                                       Page -61-
  3873.  
  3874.  
  3875.  
  3876.  
  3877.  
  3878.                           SCL1 Version 2.0 Reference Manual
  3879.  
  3880.  
  3881.                                                                     FileBox
  3882.  
  3883.           Function:    FileBox
  3884.  
  3885.           Purpose:     Displays a box with the directory information for
  3886.                        loading or selecting files.  Fills a buffer with the
  3887.                        selected file/path.  The function accepts mouse
  3888.                        input.
  3889.  
  3890.           Declaration: int FileBox(int NColor, int RColor,char *Buffer);
  3891.  
  3892.           Returns:     The return value is "-1" if the operation is
  3893.                        cancelled by the user by pressing ESC or selecting
  3894.                        the cancel option.
  3895.  
  3896.           Parameters:
  3897.  
  3898.                 NColor - color attributes for normal color display
  3899.                          (integer).
  3900.  
  3901.                 RColor - color attributes for reverse color display
  3902.                          (integer).
  3903.  
  3904.                 Buffer - char pointer to buffer to hold selected filename. 
  3905.                          The search string is placed in the buffer before
  3906.                          calling the function.  If an empty buffer is used
  3907.                          (NO SEARCH STRING SPECIFIED), the function will
  3908.                          place the default path and the "*.*" search string
  3909.                          in the buffer.
  3910.  
  3911.           Example:
  3912.  
  3913.           #include <scl1.h>
  3914.           #include <scl1clor.h>
  3915.  
  3916.           int Color1=BLACK_WHITE;
  3917.           int Color2=WHITE_BLACK;
  3918.  
  3919.           char FileBuf[80]; /* Buffer big enough so that the directory
  3920.                                information will fit */
  3921.           main()
  3922.              {
  3923.              FileBox(Color1,Color2,FileBuf);
  3924.              WriteScreen(Color1,20,12,"You have Selected:");
  3925.              WriteScreen(Color1,20,33,FileBuf);
  3926.              }
  3927.  
  3928.           See also FileBox2 and WFileBox
  3929.  
  3930.  
  3931.                                       Page -62-
  3932.  
  3933.  
  3934.  
  3935.  
  3936.  
  3937.                           SCL1 Version 2.0 Reference Manual
  3938.  
  3939.  
  3940.                                                                    FileBox2
  3941.  
  3942.           Function:    FileBox2
  3943.  
  3944.           Purpose:     Displays a box with the directory information for
  3945.                        loading or selecting files.  Fills a buffer with the
  3946.                        selected file/path.  The function accepts mouse
  3947.                        input. The function automatically senses the current
  3948.                        video mode and adjusts the display accordingly.
  3949.  
  3950.           Declaration: int FileBox2(int Message, FBData *p)
  3951.  
  3952.           Returns:     This is a dialog derived function. See Appendix "E"
  3953.                        for a description of the general operation of these
  3954.                        functions.  The return values are the messages
  3955.                        described in the Messages section.
  3956.  
  3957.           Parameters:
  3958.  
  3959.           The file box information is given in a structure type FBData as
  3960.           follows:
  3961.  
  3962.           Structure type FBData;
  3963.  
  3964.           typedef struct{
  3965.              int NColor;
  3966.              int RColor;
  3967.              int UpperRow;
  3968.              int LeftCol;
  3969.              int LowerRow;
  3970.              int RightCol;
  3971.              char *Filename;
  3972.              int Attrib;
  3973.              }FBData;
  3974.  
  3975.           where,
  3976.  
  3977.                 NColor - normal color for the file box display (integer).
  3978.  
  3979.                 RColor - reversed color for the file box display (integer).
  3980.  
  3981.               UpperRow - upper row coordinate for the file box's display
  3982.                          (integer).
  3983.  
  3984.                LeftCol - left column coordinate for the file box's display
  3985.                          (integer).
  3986.  
  3987.               LowerRow - lower row coordinate for the file box's display
  3988.                          (integer).
  3989.  
  3990.                                       Page -63-
  3991.  
  3992.  
  3993.  
  3994.  
  3995.  
  3996.                           SCL1 Version 2.0 Reference Manual
  3997.  
  3998.  
  3999.                                                                    FileBox2
  4000.  
  4001.               RightCol - right column coordinate for the file box's display
  4002.                          (integer).
  4003.  
  4004.               Filename - pointer to buffer to hold the selected filename.
  4005.                          The search string is placed in the buffer before
  4006.                          calling the function.  If an empty buffer is used
  4007.                          (NO SEARCH STRING SPECIFIED), the function will
  4008.                          place the default path and the "*.*" search string
  4009.                          into the buffer.
  4010.  
  4011.                 Attrib - file attributes as defined by the DOS. Please
  4012.                          refer to Appendix "A", FILE FUNCTIONS, for more
  4013.                          details (integer).
  4014.  
  4015.           Messages:
  4016.  
  4017.           The following messages can be sent to FileBox2:
  4018.  
  4019.                   FB_INIT - initialize the FBData structure to NULL and set
  4020.                             the following default values:
  4021.  
  4022.                             NColor - set to white characters in a black
  4023.                                      background or the normal color defined
  4024.                                      by calling SetDialogColors.
  4025.  
  4026.                             RColor - set to black characters in a white
  4027.                                      background or the reversed color
  4028.                                      defined by calling SetDialogColors.
  4029.  
  4030.                           UpperRow - set to row "5".
  4031.  
  4032.                            LeftCol - set to column "20" for 80 column
  4033.                                      displays or to column "0" for 40
  4034.                                      column displays.
  4035.  
  4036.                           LowerRow - set to row "19" for 25 row displays or
  4037.                                      to row "36" for 43 row displays.
  4038.  
  4039.                           RightCol - set to column "39" for 40 column
  4040.                                      displays and "59" for 80 column
  4041.                                      displays.
  4042.  
  4043.                             Attrib - files and sub-directories.
  4044.  
  4045.                   FB_DRAW - draw the FileBox to the screen.
  4046.  
  4047.  
  4048.  
  4049.                                       Page -64-
  4050.  
  4051.  
  4052.  
  4053.  
  4054.  
  4055.                           SCL1 Version 2.0 Reference Manual
  4056.  
  4057.  
  4058.                                                                    FileBox2
  4059.  
  4060.                 FB_ACTIVE - browse through the displayed filenames and
  4061.                             permit a selection or to cancel the operation
  4062.                             using the cursor movement keys as follows:
  4063.  
  4064.                          Key                      action
  4065.  
  4066.                        Up Arrow         cursor one item up.
  4067.                        Down Arrow       cursor one item down.
  4068.                        END              cursor to end of file list.
  4069.                        HOME             cursor to beginning of list.
  4070.                        Page Up          cursor one screen up.
  4071.                        Page Down        cursor one screen down.
  4072.  
  4073.                 FB_RESET -  when this message is sent the filebox variables
  4074.                             are reset to the default value.  If the exit
  4075.                             keys have not been defined they are set to the
  4076.                             default exit keys.
  4077.  
  4078.           The following messages can be returned by FileBox2:
  4079.  
  4080.                     FB_OK - the action requested has been performed and a
  4081.                             file has been selected.
  4082.  
  4083.                 FB_CANCEL - the operation has been cancelled.
  4084.  
  4085.           Example:
  4086.  
  4087.           #include <scl1.h>
  4088.           #include <scl1clor.H>
  4089.  
  4090.           char Buffer[80];
  4091.           int Color1=WHITE_BLACK,Color2=BLACK_WHITE;
  4092.  
  4093.           main()
  4094.              {
  4095.              FBData fbd;
  4096.  
  4097.              FileBox2(FB_INIT,&fbd);   /* initialize the FBData structure*/
  4098.              fbd.NColor=Color1;        /* change display colors */
  4099.              fbd.RColor=Color2;
  4100.              fbd.Filename=Buffer;      /* buffer to hold directory info */
  4101.              fbd.Attrib=F_READ_ONLY+F_HIDDEN+F_SYSTEM+F_DIRECTORY;
  4102.                                        /* set files attributes */
  4103.              FileBox2(FB_DRAW,&fbd);   /* display FileBox */
  4104.              FileBox2(FB_ACTIVE,&fbd); /* let user make a selection */
  4105.              }
  4106.           See also FileBox and WfileBox.
  4107.  
  4108.                                       Page -65-
  4109.  
  4110.  
  4111.  
  4112.  
  4113.  
  4114.                           SCL1 Version 2.0 Reference Manual
  4115.  
  4116.  
  4117.                                                                    File2Buf
  4118.  
  4119.           Function:    File2Buf
  4120.  
  4121.           Purpose:     Reads a file into a buffer.
  4122.  
  4123.           Declaration: int File2Buf(char* Filename, char* Buffer,
  4124.                            unsigned int* MaxSize);
  4125.  
  4126.           Returns:     The return value is "0" if no errors occurs.  When
  4127.                        errors occur the returned values are as follows: a
  4128.                        value of "-1" indicates that a critical DOS error
  4129.                        has occurred, a value of "255" indicates that the
  4130.                        file is larger than the size specified with MaxSize,
  4131.                        and the standard DOS error code for other errors. 
  4132.                        You must have called TrapInt24 before in order to
  4133.                        trap critical errors.  The number of bytes read are
  4134.                        stored in MaxSize.
  4135.  
  4136.           Parameters:
  4137.  
  4138.              Filename - valid pathname of the file to be read (char).
  4139.  
  4140.                 Buffer - buffer to hold the information (char).
  4141.  
  4142.                MaxSize - number of bytes to read (unsigned integer).
  4143.  
  4144.  
  4145.           Example:
  4146.  
  4147.           #include <scl1.h>
  4148.  
  4149.           char buffer[]="We'll write this data to disk and read it
  4150.                          back.\n";
  4151.  
  4152.           main()
  4153.              {
  4154.              int Error;
  4155.              unsigned int size;
  4156.  
  4157.              if(Error=Buf2Disk("FILE.1",buffer,sizeof(buffer)))
  4158.                 {
  4159.                 printf("Error writing file # %i\n",Error);
  4160.                 exit(-1);
  4161.                 }
  4162.  
  4163.  
  4164.  
  4165.  
  4166.  
  4167.                                       Page -66-
  4168.  
  4169.  
  4170.  
  4171.  
  4172.  
  4173.                           SCL1 Version 2.0 Reference Manual
  4174.  
  4175.  
  4176.                                                                    File2Buf
  4177.  
  4178.              size=sizeof(buffer);
  4179.              memset(buffer,0,size);
  4180.              if(Error=File2Buf("FILE.1",buffer,&size))
  4181.                 printf("Error reading file # %i\n",Error);
  4182.              else
  4183.                 printf("%s\n",buffer);
  4184.              }
  4185.           See also File2Buff and TrapInt24.
  4186.  
  4187.  
  4188.  
  4189.  
  4190.  
  4191.  
  4192.  
  4193.  
  4194.  
  4195.  
  4196.  
  4197.  
  4198.  
  4199.  
  4200.  
  4201.  
  4202.  
  4203.  
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.  
  4210.  
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.  
  4221.  
  4222.  
  4223.  
  4224.  
  4225.  
  4226.                                       Page -67-
  4227.  
  4228.  
  4229.  
  4230.  
  4231.  
  4232.                           SCL1 Version 2.0 Reference Manual
  4233.  
  4234.  
  4235.                                                                   FillBlock
  4236.  
  4237.           Function:    FillBlock
  4238.  
  4239.           Purpose:     Fills a screen area, defined with the parameters
  4240.                        passed to the function, with a given character.
  4241.  
  4242.           Declaration: void FillBlock(int Color, int UpperRow,
  4243.                             int LeftCol, int LowerRow, int RightCol,
  4244.                             int Character);
  4245.  
  4246.           Returns:     Nothing
  4247.  
  4248.           Parameters:
  4249.  
  4250.                  Color - color attribute for the display (integer).
  4251.  
  4252.               UpperRow - upper row coordinate of the display (integer).
  4253.  
  4254.                LeftCol - left column coordinate of the display (integer).
  4255.  
  4256.               LowerRow - lower row coordinate of the display (integer).
  4257.  
  4258.               RightCol - right column coordinate of the display (integer).
  4259.  
  4260.              Character - character to be used for filling the screen area. 
  4261.                          This can be any valid character (integer).
  4262.  
  4263.              (Note: the home position is row 0, column 0.)
  4264.  
  4265.           Example:
  4266.  
  4267.           #include <scl1.h>
  4268.           #include <scl1clor.h>
  4269.  
  4270.           int Color1=BLACK_WHITE;
  4271.  
  4272.           main()
  4273.              {
  4274.              FillBlock(Color1,2,2,20,40,178);
  4275.              /* Will fill the area between rows 2-10 and columns 20-40 with
  4276.                 character 178. */
  4277.              }
  4278.  
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284.  
  4285.                                       Page -68-
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.                           SCL1 Version 2.0 Reference Manual
  4292.  
  4293.  
  4294.                                                                   FindFirst
  4295.                                                                    FindNext
  4296.  
  4297.           Function:    FindFirst
  4298.                        FindNext
  4299.  
  4300.           Purpose:     Searches a disk directory for the file that matches
  4301.                        the specified search attributes using DOS system
  4302.                        call 0x4e.  After finding the first matching file
  4303.                        you must use FindNext to get subsequent matching
  4304.                        files.
  4305.  
  4306.           Declaration: int FindFirst(char *SearchString,struct FileData
  4307.                                *Buffer,int SearchAtr);
  4308.  
  4309.                        int FindNext(void);
  4310.  
  4311.           Returns:     The return value is "0" if no error occurs or the
  4312.                        DOS error code if an error occurs.  (See Appendix
  4313.                        "A", FILE FUNCTIONS, for more information). DOS
  4314.                        error code "18" is returned when no more files are
  4315.                        found.
  4316.  
  4317.           Parameters:
  4318.  
  4319.              SearchString - pointer to a string with the search mask to be
  4320.                             used (for example C:\BIN\*.EXE). If a matching
  4321.                             file is found the FileData structure is filled
  4322.                             with the file information.
  4323.  
  4324.                  FileData - pointer to a structure of type FileData defined
  4325.                             in SCL1.H:
  4326.  
  4327.                 struct FileData{
  4328.                    char reserved[21];
  4329.                    char attrib;
  4330.                    struct FILETIME time;
  4331.                    struct FILEDATE date;
  4332.                    long size;
  4333.                    char name[13];
  4334.                    };
  4335.  
  4336.              where,
  4337.  
  4338.                  reserved - is an area reserved by DOS for subsequent calls
  4339.                             to FindNext (char).
  4340.  
  4341.  
  4342.  
  4343.  
  4344.                                       Page -69-
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.                           SCL1 Version 2.0 Reference Manual
  4351.  
  4352.  
  4353.                                                                   FindFirst
  4354.                                                                    FindNext
  4355.  
  4356.                    attrib - Identifies the type of file found. Can be one
  4357.                             or more of the following constants defined in
  4358.                             SCL1.H: (use an OR operation to add them)
  4359.  
  4360.                                      F_READ_ONLY
  4361.                                      F_HIDDEN
  4362.                                      F_SYSTEM
  4363.                                      F_VOLUME
  4364.                                      F_DIRECTORY
  4365.                                      F_ARCHIVE
  4366.  
  4367.                      time - structure with bit-fields members that holds
  4368.                             the time when the file was created or last
  4369.                             updated. FILETIME structure is defined in
  4370.                             SCL1.H:
  4371.  
  4372.                             struct FILETIME{
  4373.                                   unsigned int seconds:5;
  4374.                                   unsigned int minutes:6;
  4375.                                   unsigned int hours:5;
  4376.                                   };
  4377.  
  4378.                             where,
  4379.  
  4380.                               seconds - integer value from "0" to "59".
  4381.                               minutes - integer value from "0" to "59".
  4382.                                 hours - integer value from "0" to "24".
  4383.  
  4384.                      date - structure with bit-fields members that holds
  4385.                             the date when the file was created or last
  4386.                             updated. FILEDATE structure is defined in
  4387.                             SCL1.H:
  4388.  
  4389.                             struct FILEDATE{
  4390.                                   unsigned int day:5;
  4391.                                   unsigned int month:4;
  4392.                                   unsigned int year:7;
  4393.                                   };
  4394.  
  4395.                             where,
  4396.  
  4397.                                  year - integer value from "0" to "119", to
  4398.                                         get the real year add "80" to this
  4399.                                         value.
  4400.  
  4401.                                 month - integer value from "1" to "12".
  4402.  
  4403.                                       Page -70-
  4404.  
  4405.  
  4406.  
  4407.  
  4408.  
  4409.                           SCL1 Version 2.0 Reference Manual
  4410.  
  4411.  
  4412.                                                                   FindFirst
  4413.                                                                    FindNext
  4414.  
  4415.                                   day - integer value from "1" to "31".
  4416.  
  4417.                      size - File's size in bytes (long integer).
  4418.  
  4419.                      name - File's name.
  4420.  
  4421.                 SearchAtr - is the DOS file attribute of eligible files.
  4422.                             The following attribute constants have been
  4423.                             defined in SCL1.H:
  4424.  
  4425.                    F_ARCHIVE - only archive files will be reported.
  4426.  
  4427.                  F_DIRECTORY - archive and directories will be reported.
  4428.  
  4429.                  F_READ_ONLY - archive and read-only files will be
  4430.                                reported.
  4431.  
  4432.                     F_HIDDEN - archive and hidden files will be reported.
  4433.  
  4434.                     F_SYSTEM - archive and system files will be reported.
  4435.  
  4436.                     F_VOLUME - ONLY the volume label is reported.
  4437.  
  4438.              NOTE: This functions sets the DTA (Disk Transfer Area) to
  4439.                    point to the FileData structure. Is important that you
  4440.                    do not modify the DTA between a call to FindFirst and
  4441.                    FindNext.
  4442.  
  4443.           Example:
  4444.  
  4445.           #include <scl1.h>
  4446.  
  4447.           #define NO_MORE_FILES   18
  4448.  
  4449.           static void printinfo(struct FileData *fd);
  4450.  
  4451.           main()
  4452.           {
  4453.           struct FileData fd;  /* file info will be stored here */
  4454.           int RetVal;
  4455.  
  4456.           RetVal=FindFirst("*.*",&fd,F_VOLUME);   /* read volume label */
  4457.           if(RetVal==NO_MORE_FILES)          /* no more files? */
  4458.               printf("\nVolume has no label\n\n");
  4459.           else
  4460.               printf("\nVolume label: %s\n\n",fd.name);
  4461.  
  4462.                                       Page -71-
  4463.  
  4464.  
  4465.  
  4466.  
  4467.  
  4468.                           SCL1 Version 2.0 Reference Manual
  4469.  
  4470.  
  4471.                                                                   FindFirst
  4472.                                                                    FindNext
  4473.  
  4474.              /* read other files. Subdirectories, hidden, system and
  4475.                 archive files */
  4476.  
  4477.           RetVal=FindFirst("*.*",&fd,F_DIRECTORY | F_SYSTEM | F_HIDDEN);
  4478.  
  4479.              /* Get filenames while no error is reported */
  4480.  
  4481.           while(RetVal==0)
  4482.               {
  4483.               printinfo(&fd);     /* print file information */
  4484.               RetVal=FindNext();  /* get next file */
  4485.               }
  4486.           }
  4487.  
  4488.           static void printinfo(struct FileData *fd)
  4489.           {
  4490.           printf("%-13s",fd->name); /* print file name */
  4491.  
  4492.              /* if file is not a directory, print file size */
  4493.  
  4494.           if(fd->attrib == F_DIRECTORY)
  4495.               printf("  <DIR>");
  4496.           else
  4497.               printf("%7li",fd->size);
  4498.  
  4499.           /* print date and time */
  4500.  
  4501.           printf("  %.2i-%.2i-%.2i  %.2i:%.2i:%.2i\n",fd->date.month,
  4502.                  fd->date.day,fd->date.year+80,fd->time.hours,
  4503.                  fd->time.minutes, fd->time.seconds);
  4504.           }
  4505.  
  4506.  
  4507.  
  4508.  
  4509.  
  4510.  
  4511.  
  4512.  
  4513.  
  4514.  
  4515.  
  4516.  
  4517.  
  4518.  
  4519.  
  4520.  
  4521.                                       Page -72-
  4522.  
  4523.  
  4524.  
  4525.  
  4526.  
  4527.                           SCL1 Version 2.0 Reference Manual
  4528.  
  4529.  
  4530.                                                                   GetCurCol
  4531.                                                                  GetCurLine
  4532.  
  4533.           Function:    GetCurCol
  4534.                        GetCurLine
  4535.  
  4536.           Purpose:     Returns the current cursor position.
  4537.  
  4538.           Declaration: char GetCurCol(char);
  4539.                        char GetCurLine(void);
  4540.  
  4541.           Returns:     GetCurCol returns the column position and GetCurLine
  4542.                        returns the row position.
  4543.  
  4544.           Parameters:  None
  4545.  
  4546.           Example:
  4547.  
  4548.           #include <scl1.h>
  4549.  
  4550.           main()
  4551.              {
  4552.              int Line,Col;
  4553.  
  4554.              Col=GetCurCol();
  4555.              Line=GetCurLine();
  4556.              printf("Cursor position before writing this string:
  4557.                     %i, %i\n",Line,Col);
  4558.              }
  4559.  
  4560.  
  4561.  
  4562.  
  4563.  
  4564.  
  4565.  
  4566.  
  4567.  
  4568.  
  4569.  
  4570.  
  4571.  
  4572.  
  4573.  
  4574.  
  4575.  
  4576.  
  4577.  
  4578.  
  4579.  
  4580.                                       Page -73-
  4581.  
  4582.  
  4583.  
  4584.  
  4585.  
  4586.                           SCL1 Version 2.0 Reference Manual
  4587.  
  4588.  
  4589.                                                               GetCurrentDir
  4590.  
  4591.           Function:    GetCurrentDir
  4592.  
  4593.           Purpose:     Returns an ASCII string holding the default drive
  4594.                        and path.
  4595.  
  4596.           Declaration: int GetCurrentDir(char *PathBuffer);
  4597.  
  4598.           Returns:     The return value is "0" if no error occurs or the
  4599.                        DOS error code if an error occurs.  (See Appendix
  4600.                        "A", FILE FUNCTIONS, for more information).
  4601.  
  4602.           Parameters:
  4603.  
  4604.             PathBuffer - pointer to a buffer to hold the pathname and drive
  4605.                          letter (char).
  4606.  
  4607.           Example:
  4608.  
  4609.           #include <slc1.h>
  4610.  
  4611.           main()
  4612.              {
  4613.              int RetCode;
  4614.              char Buffer[80];
  4615.  
  4616.              RetCode=GetCurrentDir(Buffer);
  4617.              }
  4618.  
  4619.  
  4620.  
  4621.  
  4622.  
  4623.  
  4624.  
  4625.  
  4626.  
  4627.  
  4628.  
  4629.  
  4630.  
  4631.  
  4632.  
  4633.  
  4634.  
  4635.  
  4636.  
  4637.  
  4638.  
  4639.                                       Page -74-
  4640.  
  4641.  
  4642.  
  4643.  
  4644.  
  4645.                           SCL1 Version 2.0 Reference Manual
  4646.  
  4647.  
  4648.                                                                  GetCurSize
  4649.  
  4650.           Function:    GetCurSize
  4651.  
  4652.           Purpose:     Saves the current cursor size in variable
  4653.                        GCS_CursorSize and returns the current cursor size.
  4654.  
  4655.           Declaration: int GetCurSize(void);
  4656.  
  4657.           Returns:     The return value is the current cursor size.
  4658.  
  4659.           Parameters:  None
  4660.  
  4661.           Example:
  4662.  
  4663.           #include <scl1.h>
  4664.  
  4665.           main()
  4666.              {
  4667.              GetCurSize();                   /* Save actual size */
  4668.              BigCursor();                    /* Change size */
  4669.              SetCurSize(GCS_CursorSize);     /* Restore previous size */
  4670.              }
  4671.  
  4672.  
  4673.  
  4674.  
  4675.  
  4676.  
  4677.  
  4678.  
  4679.  
  4680.  
  4681.  
  4682.  
  4683.  
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.  
  4693.  
  4694.  
  4695.  
  4696.  
  4697.  
  4698.                                       Page -75-
  4699.  
  4700.  
  4701.  
  4702.  
  4703.  
  4704.                           SCL1 Version 2.0 Reference Manual
  4705.  
  4706.  
  4707.                                                                     GetDate
  4708.  
  4709.           Function:    GetDate
  4710.  
  4711.           Purpose:     Gets the system date.
  4712.  
  4713.           Declaration: struct DateData * GetDate(void);
  4714.  
  4715.           Returns:     The return value is a pointer to the DateData
  4716.                        structure defined as follows:
  4717.  
  4718.           struct DateData{
  4719.              int WeekDay;
  4720.              int MonthDay;
  4721.              int Month;
  4722.              int Year;
  4723.              };
  4724.  
  4725.           where,
  4726.  
  4727.                WeekDay - day of the week in numerical format
  4728.                          (0=sunday,etc.) (integer).
  4729.  
  4730.               MonthDay - day of the month (1 - 31) (integer).
  4731.  
  4732.                  Month - month number (1 - 12) (integer).
  4733.  
  4734.                   Year - year (1980 - 2099) (integer).
  4735.  
  4736.           Parameters:  None
  4737.  
  4738.           Example:
  4739.  
  4740.  
  4741.           #include <scl1.h>
  4742.           #include <scl1clor.h>
  4743.  
  4744.           char *Day[]={"Sunday","Monday","Tuesday","Wednesday",
  4745.                       "Thursday","Friday","Saturday"};
  4746.  
  4747.           char *Month[]={"","January","February","March","April","May",
  4748.                         "June","July","August","September","October",
  4749.                         "November","December"};
  4750.  
  4751.  
  4752.  
  4753.  
  4754.  
  4755.  
  4756.  
  4757.                                       Page -76-
  4758.  
  4759.  
  4760.  
  4761.  
  4762.  
  4763.                           SCL1 Version 2.0 Reference Manual
  4764.  
  4765.  
  4766.                                                                     GetDate
  4767.  
  4768.           main()
  4769.              {
  4770.              struct DateData *p;
  4771.  
  4772.              p=GetDate();
  4773.              /* p points to DateData structure:
  4774.                 p->WeekDay = day of the week (0=Sunday),
  4775.                 p->MonthDay = day (1-31),
  4776.                 p->Month = month (1-12)
  4777.                 p->Year = year (1980 - 2099).
  4778.  
  4779.              The month and day numbers reported by GetDate will be used as
  4780.              index to the week and months names arrays we have previously
  4781.              defined. Use printf to print this data */
  4782.  
  4783.              printf("Today is %s, %s %d,%d",Day[p->WeekDay],
  4784.                      Month[p->Month],p->MonthDay,p->Year);
  4785.  
  4786.              }
  4787.  
  4788.  
  4789.  
  4790.  
  4791.  
  4792.  
  4793.  
  4794.  
  4795.  
  4796.  
  4797.  
  4798.  
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804.  
  4805.  
  4806.  
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.  
  4813.  
  4814.  
  4815.  
  4816.                                       Page -77-
  4817.  
  4818.  
  4819.  
  4820.  
  4821.  
  4822.                           SCL1 Version 2.0 Reference Manual
  4823.  
  4824.  
  4825.                                                             GetDefaultDrive
  4826.  
  4827.           Function:    GetDefaultDrive
  4828.  
  4829.           Purpose:     Gets the default disk drive.
  4830.  
  4831.           Declaration: int GetDefaultDrive(void);
  4832.  
  4833.           Returns:     The return value indicates the default drive number,
  4834.                        0=A, 1=B, etc.
  4835.  
  4836.           Parameters:  None
  4837.  
  4838.           Example:
  4839.  
  4840.           #include <slc1.h>
  4841.  
  4842.           main()
  4843.              {
  4844.              int Drive;
  4845.  
  4846.              Drive=GetDefaultDrive();
  4847.              printf("The default drive is %c\n",'A'+Drive)
  4848.              }
  4849.  
  4850.  
  4851.  
  4852.  
  4853.  
  4854.  
  4855.  
  4856.  
  4857.  
  4858.  
  4859.  
  4860.  
  4861.  
  4862.  
  4863.  
  4864.  
  4865.  
  4866.  
  4867.  
  4868.  
  4869.  
  4870.  
  4871.  
  4872.  
  4873.  
  4874.  
  4875.                                       Page -78-
  4876.  
  4877.  
  4878.  
  4879.  
  4880.  
  4881.                           SCL1 Version 2.0 Reference Manual
  4882.  
  4883.  
  4884.                                                            GetDiskFreeSpace
  4885.  
  4886.           Function:    GetDiskFreeSpace
  4887.  
  4888.           Purpose:     Gets the selected disk drive's free space in bytes.
  4889.  
  4890.           Declaration: long GetDefaultDrive(int Drive);
  4891.  
  4892.           Returns:     The number of bytes free in the selected drive, "-1"
  4893.                        if TrapInt24 was initialized and a critical error
  4894.                        occurs or "-2" if the drive number is illegal.
  4895.  
  4896.           Parameters:
  4897.  
  4898.                  Drive - Drive number (integer):
  4899.                      0 = default
  4900.                      1 = A
  4901.                      2 = B, etc.
  4902.  
  4903.           Example:
  4904.  
  4905.           #include <slc1.h>
  4906.  
  4907.           main()
  4908.              {
  4909.  
  4910.              printf("Disk Free Space=%li\n",GetDiskFreeSpace(0));
  4911.              }
  4912.  
  4913.  
  4914.  
  4915.  
  4916.  
  4917.  
  4918.  
  4919.  
  4920.  
  4921.  
  4922.  
  4923.  
  4924.  
  4925.  
  4926.  
  4927.  
  4928.  
  4929.  
  4930.  
  4931.  
  4932.  
  4933.  
  4934.                                       Page -79-
  4935.  
  4936.  
  4937.  
  4938.  
  4939.  
  4940.                           SCL1 Version 2.0 Reference Manual
  4941.  
  4942.  
  4943.                                                            GetExtendedAscii
  4944.  
  4945.           Function:    GetExtendedAscii
  4946.  
  4947.           Purpose:     Changes ALT+Key combination into Extended Ascii
  4948.                        character according to 4 tables:
  4949.  
  4950.                        Table 0 - Spanish characters.
  4951.                        Table 1 - Other language characters.
  4952.                        Table 2 - Graphic characters.
  4953.                        Table 3 - Greek letters, math symbols.
  4954.  
  4955.           Declaration: unsigned int GetExtendedAscii(unsigned int Key);
  4956.  
  4957.           Returns:     The Ascii Code, if found (<"255"), or original
  4958.                        Scan+Ascii Code, if not found (>"255").
  4959.  
  4960.           Table 0 is the default. To change table set variable GE_CharTable
  4961.           to desired table number.  The tables have been defined as
  4962.           follows:
  4963.  
  4964.                 Table 0 -
  4965.                 ALT+   aeiouvnm12
  4966.                        áéíóúüñÑ¡¿
  4967.  
  4968.  
  4969.                 Table 1 -
  4970.                 ALT+   123456789  qwertyuiop  asdfghjkl  zxcvbnm
  4971.                        âêîôû£₧ƒ¥  áéíóúÿçÇñÑ  àèìòùÄÉÖÜ  äëïöü¡¿
  4972.  
  4973.  
  4974.                 Table 2 -
  4975.                 ALT+   123456789  qwertyuiop  asdfghjkl  zxcvbnm
  4976.                        ╔╗╚╝═║░▒▓  ╦╠╣╩╬█▄▌▐▀  ┌┐└┘─│°∙·  ┬├┤┴┼«»
  4977.  
  4978.  
  4979.                 Table 3 -
  4980.                 ALT+   123456789  qwertyui  asdfghjkl  zx
  4981.                        αßΓπΣσµτΦ  ΘΩδ∞φε∩≡  ±≥≤⌠⌡÷≈√ⁿ  ² 
  4982.  
  4983.  
  4984.           (Note: You will not be to print the correct characters if your
  4985.           printer does not support the IBM extended ASCII character set.)
  4986.  
  4987.           Parameters:
  4988.  
  4989.                    Key - Scan and ASCII code of a key (unsigned integer).
  4990.  
  4991.  
  4992.  
  4993.                                       Page -80-
  4994.  
  4995.  
  4996.  
  4997.  
  4998.  
  4999.                           SCL1 Version 2.0 Reference Manual
  5000.  
  5001.  
  5002.                                                            GetExtendedAscii
  5003.  
  5004.           Example:
  5005.  
  5006.           #include <slc1.h>
  5007.           #include <scl1keys.h>
  5008.  
  5009.           main()
  5010.              {
  5011.              unsigned int key;
  5012.  
  5013.              do
  5014.                 {
  5015.                 printf("Press an ALT + Key combination...");
  5016.                 key=GetKey();
  5017.                 if((key=GetExtendenAscii(key)) < 255)
  5018.                    {
  5019.                    printf("%c\n",key);
  5020.                    break;
  5021.                    }
  5022.                 else
  5023.                    printf("\nThis key combination has not been defined, 
  5024.                             try again!\n:);
  5025.                 }while(1);
  5026.              }
  5027.  
  5028.  
  5029.  
  5030.  
  5031.  
  5032.  
  5033.  
  5034.  
  5035.  
  5036.  
  5037.  
  5038.  
  5039.  
  5040.  
  5041.  
  5042.  
  5043.  
  5044.  
  5045.  
  5046.  
  5047.  
  5048.  
  5049.  
  5050.  
  5051.  
  5052.                                       Page -81-
  5053.  
  5054.  
  5055.  
  5056.  
  5057.  
  5058.                           SCL1 Version 2.0 Reference Manual
  5059.  
  5060.  
  5061.                                                                    GetFiles
  5062.  
  5063.           Function:    GetFiles
  5064.  
  5065.           Purpose:     Searches for the files that match the specified
  5066.                        search string and attributes.  Sets global variable
  5067.                        GF_FileNumber to the number of files found and
  5068.                        initialize an array of pointers, GF_PointerBuf,
  5069.                        which will point to the filenames.
  5070.  
  5071.           Declaration: int GetFiles(char *SearchString,int SearchAtr);
  5072.  
  5073.           Returns:     The return value is "0" if no error occurs or the
  5074.                        DOS error code if an error occurs.  (See Appendix
  5075.                        "A", FILE FUNCTIONS, for more information).
  5076.  
  5077.           Parameters:
  5078.  
  5079.           SearchString - char pointer to the desired search string.
  5080.  
  5081.              SearchAtr - variable that defines the desired search
  5082.                          attributes (integer).
  5083.  
  5084.           Example:
  5085.  
  5086.           #include <scl1.h>
  5087.  
  5088.           main()
  5089.              {
  5090.              int i;
  5091.  
  5092.  
  5093.              if(i=GetFiles("*.*",F_ARCHIVE+F_DIRECTORY))
  5094.                 printf("GetFiles reports error number %i\n",i);
  5095.              else
  5096.                 {
  5097.                 for(i=0;i < GF_FileNumber;++i)
  5098.                    printf("%s\n",GF_PointerBuf[i]);
  5099.                 }
  5100.              }
  5101.  
  5102.  
  5103.  
  5104.  
  5105.  
  5106.  
  5107.  
  5108.  
  5109.  
  5110.  
  5111.                                       Page -82-
  5112.  
  5113.  
  5114.  
  5115.  
  5116.  
  5117.                           SCL1 Version 2.0 Reference Manual
  5118.  
  5119.  
  5120.                                                                 GetFileMode
  5121.  
  5122.           Function:    GetFileMode
  5123.  
  5124.           Purpose:     Gets the selected file's attributes.
  5125.  
  5126.           Declaration: int GetFileMode(char *Filename,int *FMode);
  5127.  
  5128.           Returns:     The return value is 0 if no error occur or the DOS
  5129.                        error code if an error occur.  (See Appendix "A",
  5130.                        FILE FUNCTIONS, for more information).
  5131.  
  5132.           Parameters:
  5133.  
  5134.               Filename - pointer to the file's name.
  5135.  
  5136.                  Fmode - variable that holds the file mode (integer).
  5137.  
  5138.                 The following masks has been defined in SCL1.H:
  5139.  
  5140.                 F_READ_ONLY, F_HIDDEN, F_SYSTEM, F_VOLUME, F_DIRECTORY,
  5141.                 F_ARCHIVE
  5142.  
  5143.           Example:
  5144.  
  5145.           #include <scl1.h>
  5146.  
  5147.           char Filename[]="FILE.1";
  5148.  
  5149.           main()
  5150.           {
  5151.           int handle;
  5152.           unsigned int FMode;
  5153.  
  5154.           if(CreateFile(Filename,&handle,F_ARCHIVE))
  5155.              exit(-1);
  5156.           if(GetFileMode(Filename,&FMode))
  5157.              exit(-1);
  5158.           PrintFMode(FMode);
  5159.           if(SetFileMode(Filename,F_READ_ONLY | F_SYSTEM | F_HIDDEN))
  5160.              exit(-1);
  5161.           if(GetFileMode(Filename,&FMode))
  5162.              exit(-1);
  5163.           PrintFMode(FMode);
  5164.           if(SetFileMode(Filename,F_ARCHIVE))
  5165.              exit(-1);
  5166.           DeleteFile(Filename);
  5167.           }
  5168.  
  5169.  
  5170.                                       Page -83-
  5171.  
  5172.  
  5173.  
  5174.  
  5175.  
  5176.                           SCL1 Version 2.0 Reference Manual
  5177.  
  5178.  
  5179.                                                                 GetFileMode
  5180.  
  5181.           PrintFMode(unsigned int FMode)
  5182.           {
  5183.           printf("\nFile attributtes:\n\n");
  5184.           if(FMode & F_READ_ONLY)
  5185.              printf("\tRead Only\n");
  5186.           if(FMode & F_HIDDEN)
  5187.              printf("\tHidden\n");
  5188.           if(FMode & F_SYSTEM)
  5189.              printf("\tSystem\n");
  5190.           if(FMode & F_ARCHIVE)
  5191.              printf("\tArchive\n");
  5192.           }
  5193.  
  5194.  
  5195.  
  5196.  
  5197.  
  5198.  
  5199.  
  5200.  
  5201.  
  5202.  
  5203.  
  5204.  
  5205.  
  5206.  
  5207.  
  5208.  
  5209.  
  5210.  
  5211.  
  5212.  
  5213.  
  5214.  
  5215.  
  5216.  
  5217.  
  5218.  
  5219.  
  5220.  
  5221.  
  5222.  
  5223.  
  5224.  
  5225.  
  5226.  
  5227.  
  5228.  
  5229.                                       Page -84-
  5230.  
  5231.  
  5232.  
  5233.  
  5234.  
  5235.                           SCL1 Version 2.0 Reference Manual
  5236.  
  5237.  
  5238.                                                                   GetFilePt
  5239.  
  5240.           Function:    GetFilePt
  5241.  
  5242.           Purpose:     Gets the file's pointer position.
  5243.  
  5244.           Declaration: long GetFilePt(int Handle);
  5245.  
  5246.           Returns:     The file pointer position of the file whose handle
  5247.                        is Handle.  Returns "-1" when a critical error is
  5248.                        detected. (See Appendix "A", FILE FUNCTIONS, for
  5249.                        more information).
  5250.  
  5251.           Parameters:
  5252.  
  5253.                FHandle - Handle returned by DOS when you open or create a
  5254.                          file (integer).
  5255.  
  5256.           Example:
  5257.  
  5258.           #include <scl1.h>
  5259.           #include <string.h>
  5260.  
  5261.              /* This example creates a file with several names in lower-
  5262.              case.  We'll read this file one record at a time into our
  5263.              buffer and convert the string to uppercase before rewriting it
  5264.              back to disk. For simplicity, no error checking is shown in
  5265.              the example */
  5266.  
  5267.           struct NAME_REC{       /* Our file format */
  5268.                char Name[7];
  5269.                }nr;             /* nr will be used as a buffer for
  5270.                                    converting strings to uppercase */
  5271.  
  5272.           /* This is the data of the file we will create */
  5273.  
  5274.           struct NAME_REC names[]={
  5275.              "John",
  5276.              "Mary",
  5277.              "Robert",
  5278.              "Ann"};
  5279.  
  5280.           main()
  5281.              {
  5282.              int handle,i,j;
  5283.              long fileptr,records;
  5284.  
  5285.  
  5286.  
  5287.  
  5288.                                       Page -85-
  5289.  
  5290.  
  5291.  
  5292.  
  5293.  
  5294.                           SCL1 Version 2.0 Reference Manual
  5295.  
  5296.  
  5297.                                                                   GetFilePt
  5298.  
  5299.               /* create file */
  5300.  
  5301.              if(Buf2Disk("DEMO.FL",(char *)names,sizeof(names)))
  5302.                 {
  5303.                 printf("Error creating file\n");
  5304.                 exit(-1);
  5305.                 }
  5306.  
  5307.              /* Open file for reading and writing */
  5308.  
  5309.              OpenFile("DEMO.FL",&handle,DOS2_RW);
  5310.  
  5311.              /* number of records in file = file size / size of structure
  5312.                 NAME_REC */
  5313.  
  5314.              records=GetFileSize(handle)/sizeof(struct NAME_REC);
  5315.  
  5316.              /* read one record at a time while there are records */
  5317.              for(;records > 0;--records)
  5318.                 {
  5319.  
  5320.                 /* save actual file pointer position */
  5321.                 fileptr=GetFilePt(handle);
  5322.  
  5323.                 /* read data, file pointer is automatically moved to next
  5324.                    record by DOS */
  5325.  
  5326.                 ReadFile(handle,(char *)&nr,sizeof(struct NAME_REC));
  5327.  
  5328.                 /* capitalize name */
  5329.                 strupr(nr.Name);
  5330.  
  5331.                 /* move file pointer to original position */
  5332.                 MoveFilePt2Offset(handle,fileptr);
  5333.  
  5334.                 /* write our data, pointer points again to next record */
  5335.                 WriteFile(handle,(char *)&nr,sizeof(struct NAME_REC));
  5336.                 }
  5337.              CloseFile(handle);
  5338.              system("type DEMO.FL");
  5339.              }
  5340.  
  5341.  
  5342.  
  5343.  
  5344.  
  5345.  
  5346.  
  5347.                                       Page -86-
  5348.  
  5349.  
  5350.  
  5351.  
  5352.  
  5353.                           SCL1 Version 2.0 Reference Manual
  5354.  
  5355.  
  5356.                                                                 GetFileSize
  5357.  
  5358.           Function:    GetFileSize
  5359.  
  5360.           Purpose:     Gets the size of the selected file.
  5361.  
  5362.           Declaration: long GetFileSize(int Handle);
  5363.  
  5364.           Returns:     The size of the file whose handle is Handle. 
  5365.                        Returns "-1" when a critical error is detected. (See
  5366.                        Appendix "A", FILE FUNCTIONS, for more information).
  5367.  
  5368.           Parameters:
  5369.  
  5370.                 Handle - Handle returned by DOS when you open or create a
  5371.                          file (integer).
  5372.  
  5373.           Example:
  5374.  
  5375.           #include <scl1.h>
  5376.           #include <string.h>
  5377.  
  5378.              /* This example creates a file with several names in lower-
  5379.              case.  We'll read this file one record at a time into our
  5380.              buffer and convert the string to uppercase before rewriting it
  5381.              back to disk. For simplicity, no error checking is shown in
  5382.              the example */
  5383.  
  5384.           struct NAME_REC{       /* Our file format */
  5385.                char Name[7];
  5386.                }nr;             /* nr will be used as a buffer for
  5387.                                    converting strings to uppercase */
  5388.  
  5389.           /* This is the data of the file we will create */
  5390.  
  5391.           struct NAME_REC names[]={
  5392.              "John",
  5393.              "Mary",
  5394.              "Robert",
  5395.              "Ann"};
  5396.  
  5397.           main()
  5398.              {
  5399.              int handle,i,j;
  5400.              long fileptr,records;
  5401.  
  5402.  
  5403.  
  5404.  
  5405.  
  5406.                                       Page -87-
  5407.  
  5408.  
  5409.  
  5410.  
  5411.  
  5412.                           SCL1 Version 2.0 Reference Manual
  5413.  
  5414.  
  5415.                                                                 GetFileSize
  5416.  
  5417.               /* create file */
  5418.  
  5419.              if(Buf2Disk("DEMO.FL",(char *)names,sizeof(names)))
  5420.                 {
  5421.                 printf("Error creating file\n");
  5422.                 exit(-1);
  5423.                 }
  5424.  
  5425.              /* Open file for reading and writing */
  5426.  
  5427.              OpenFile("DEMO.FL",&handle,DOS2_RW);
  5428.  
  5429.              /* number of records in file = file size / size of structure
  5430.                 NAME_REC */
  5431.  
  5432.              records=GetFileSize(handle)/sizeof(struct NAME_REC);
  5433.  
  5434.              /* read one record at a time while there are records */
  5435.              for(;records > 0;--records)
  5436.                 {
  5437.  
  5438.                 /* save actual file pointer position */
  5439.                 fileptr=GetFilePt(handle);
  5440.  
  5441.                 /* read data, file pointer is automatically moved to next
  5442.                    record by DOS */
  5443.  
  5444.                 ReadFile(handle,(char *)&nr,sizeof(struct NAME_REC));
  5445.  
  5446.                 /* capitalize name */
  5447.                 strupr(nr.Name);
  5448.  
  5449.                 /* move file pointer to original position */
  5450.                 MoveFilePt2Offset(handle,fileptr);
  5451.  
  5452.                 /* write our data, pointer points again to next record */
  5453.                 WriteFile(handle,(char *)&nr,sizeof(struct NAME_REC));
  5454.                 }
  5455.              CloseFile(handle);
  5456.              system("type DEMO.FL");
  5457.              }
  5458.  
  5459.  
  5460.  
  5461.  
  5462.  
  5463.  
  5464.  
  5465.                                       Page -88-
  5466.  
  5467.  
  5468.  
  5469.  
  5470.  
  5471.                           SCL1 Version 2.0 Reference Manual
  5472.  
  5473.  
  5474.                                                                  GetFreeMem
  5475.  
  5476.           Function:    GetFreeMem
  5477.  
  5478.           Purpose:     Gets the free memory reported by the DOS in your
  5479.                        system.
  5480.  
  5481.           Declaration: long GetFreeMem(void);
  5482.  
  5483.           Returns:     The return value is the amount of free memory, in
  5484.                        bytes, reported by the DOS.
  5485.  
  5486.           Parameters:  None
  5487.  
  5488.           Example:
  5489.  
  5490.  
  5491.           #include <scl1.h>
  5492.  
  5493.           main()
  5494.              {
  5495.              printf("Available memory: %li",GetFreeMem());
  5496.              }
  5497.  
  5498.  
  5499.  
  5500.  
  5501.  
  5502.  
  5503.  
  5504.  
  5505.  
  5506.  
  5507.  
  5508.  
  5509.  
  5510.  
  5511.  
  5512.  
  5513.  
  5514.  
  5515.  
  5516.  
  5517.  
  5518.  
  5519.  
  5520.  
  5521.  
  5522.  
  5523.  
  5524.                                       Page -89-
  5525.  
  5526.  
  5527.  
  5528.  
  5529.  
  5530.                           SCL1 Version 2.0 Reference Manual
  5531.  
  5532.  
  5533.                                                                      GetKey
  5534.  
  5535.           Function:    GetKey
  5536.  
  5537.           Purpose:     Waits and returns the pressed key's Scan/ASCII code.
  5538.  
  5539.           Declaration: unsigned int GetKey(void);
  5540.  
  5541.           Returns:     The Scan/Ascii code of the pressed key. See Appendix
  5542.                        "D" for the variables defined in SCL1KEYS.H.
  5543.  
  5544.           Parameters:  None
  5545.  
  5546.           Example:
  5547.  
  5548.           #include <scl1.h>
  5549.           #include <scl1keys.h>
  5550.  
  5551.           main()
  5552.              {
  5553.              unsigned int Key;
  5554.  
  5555.              switch(Key=GetKey())
  5556.                    {
  5557.                    case F1:
  5558.                        .
  5559.                        .
  5560.                    case F2:
  5561.                        .
  5562.                        .
  5563.                    }
  5564.              }
  5565.  
  5566.  
  5567.  
  5568.  
  5569.  
  5570.  
  5571.  
  5572.  
  5573.  
  5574.  
  5575.  
  5576.  
  5577.  
  5578.  
  5579.  
  5580.  
  5581.  
  5582.  
  5583.                                       Page -90-
  5584.  
  5585.  
  5586.  
  5587.  
  5588.  
  5589.                           SCL1 Version 2.0 Reference Manual
  5590.  
  5591.  
  5592.                                                                   GetString
  5593.  
  5594.           Function:    GetString
  5595.  
  5596.           Purpose:     Saves and restores the cursor's size and position,
  5597.                        displays a prompt and the current buffer contents,
  5598.                        positions the cursor and fills the buffer with
  5599.                        keyboard input.  The type and number of characters
  5600.                        are specified. Supports INSERT, DELETE, BACKSPACE,
  5601.                        HOME and END editing keys and mouse input.  If
  5602.                        variable GS_Insert is set to "1" prior to calling
  5603.                        GetString, it will start in the insert mode.  When
  5604.                        no entry has been made into the buffer the variable
  5605.                        GS_Edit is set to "0", otherwise it is set to "1". 
  5606.                        If GS_Beep is set to "1" the console speaker will
  5607.                        sound if an invalid key is pressed.  The buffer must
  5608.                        be initialized with a null terminated string or null
  5609.                        string.
  5610.  
  5611.           Declaration: int GetString(int PColor, int PRow, int PCol,
  5612.                            char* Prompt, int FColor, int FRow, int FCol,
  5613.                            int MaxChar, unsigned int CharType,
  5614.                            char *Buffer);
  5615.  
  5616.           Returns:     Returns the number of characters in buffer or "-1"
  5617.                        if the Esc key is pressed.
  5618.  
  5619.           Parameters:
  5620.  
  5621.                 PColor - color attribute of the prompt (integer).
  5622.  
  5623.                   PRow - row position where to display the prompt
  5624.                          (integer).
  5625.  
  5626.                   PCol - column position where to display the prompt
  5627.                          (integer).
  5628.  
  5629.                 Prompt - pointer to the prompt to be displayed (char).
  5630.  
  5631.                 FColor - color attribute of the field (integer).
  5632.  
  5633.                   FRow - row position where to display the field (integer).
  5634.  
  5635.                   FCol - column position where to display the field
  5636.                          (integer).
  5637.  
  5638.                MaxChar - length of the input field (integer).
  5639.  
  5640.  
  5641.  
  5642.                                       Page -91-
  5643.  
  5644.  
  5645.  
  5646.  
  5647.  
  5648.                           SCL1 Version 2.0 Reference Manual
  5649.  
  5650.  
  5651.                                                                   GetString
  5652.  
  5653.               CharType - the mask of valid characters as described in
  5654.                          function CheckChar. (refer to Appendix "D").
  5655.  
  5656.                 Buffer - pointer to the buffer to be used to store the
  5657.                          field, it must be one digit larger than the
  5658.                          field's size to place the string termination null
  5659.                          character.
  5660.  
  5661.           Example:
  5662.  
  5663.           #include <scl1.h>
  5664.           #include <scl1clor.h>
  5665.  
  5666.           int Color1=BLACK_WHITE;
  5667.           int Color2=WHITE_BLACK;
  5668.  
  5669.           char Buffer[32];
  5670.  
  5671.           main()
  5672.              {
  5673.              GetString(Color1,10,20,"Name:",Color2,10,28,31,CC_ANY,Buffer);
  5674.              }
  5675.  
  5676.  
  5677.  
  5678.  
  5679.  
  5680.  
  5681.  
  5682.  
  5683.  
  5684.  
  5685.  
  5686.  
  5687.  
  5688.  
  5689.  
  5690.  
  5691.  
  5692.  
  5693.  
  5694.  
  5695.  
  5696.  
  5697.  
  5698.  
  5699.  
  5700.  
  5701.                                       Page -92-
  5702.  
  5703.  
  5704.  
  5705.  
  5706.  
  5707.                           SCL1 Version 2.0 Reference Manual
  5708.  
  5709.  
  5710.                                                                     GetTime
  5711.  
  5712.           Function:    GetTime
  5713.  
  5714.           Purpose:     Gets the system time.
  5715.  
  5716.           Declaration: char *GetTime(void);
  5717.  
  5718.           Returns:     The return value is a pointer to a buffer that holds
  5719.                        the system time in ASCII.  Set global variables
  5720.                        GT_Hours, GT_Minutes, GT_Seconds and GT_Hundredths
  5721.                        to the system time.
  5722.  
  5723.           Parameters:  None
  5724.  
  5725.           Example:
  5726.  
  5727.           #include <scl1.h>
  5728.           #include <scl1clor.h>
  5729.  
  5730.           int Color1=BLACK_WHITE;
  5731.  
  5732.           main()
  5733.              {
  5734.              WriteScreen(Color1,3,3,"Time:");
  5735.              WriteScreen(Color1,3,9,GetTime());
  5736.              }
  5737.  
  5738.  
  5739.  
  5740.  
  5741.  
  5742.  
  5743.  
  5744.  
  5745.  
  5746.  
  5747.  
  5748.  
  5749.  
  5750.  
  5751.  
  5752.  
  5753.  
  5754.  
  5755.  
  5756.  
  5757.  
  5758.  
  5759.  
  5760.                                       Page -93-
  5761.  
  5762.  
  5763.  
  5764.  
  5765.  
  5766.                           SCL1 Version 2.0 Reference Manual
  5767.  
  5768.  
  5769.                                                                      GSSBox
  5770.  
  5771.           Function:    GSSBox
  5772.  
  5773.           Purpose:     Draws a box with one of 12 predefined types of
  5774.                        frames. The minimum box size is 2 rows and 2
  5775.                        columns.  The function does not perform bound
  5776.                        checking, the box will spill out of the desired area
  5777.                        if the coordinates are outside the screen range. 
  5778.                        The function draws a box frame and fills its
  5779.                        interior.  Three flags; Grow, Noise and Shadow can
  5780.                        be specified.  The grow flag signals the function to
  5781.                        draw the box with a growing effect, the noise flag
  5782.                        signals the function to make a swirling noise when
  5783.                        drawing the box, and the shadow flag signals the
  5784.                        function to add a shadow effect.  If you do not
  5785.                        specify a shadow color (using the SetShadowColor
  5786.                        function) it will be XOR'ed to the current
  5787.                        background color.  Make sure to leave space for the
  5788.                        shadow characters.  You can define other types of
  5789.                        frames using the SetUserBox function.
  5790.  
  5791.           Declaration: void GSSBox(int Color, int FrameType,
  5792.                             int UpperRow, int LeftCol, int LowerRow,
  5793.                             int RightCol,int GrowFl,int SoundFl,
  5794.                             int ShadowFl);
  5795.  
  5796.           Returns:     Nothing
  5797.  
  5798.           Parameters:
  5799.  
  5800.                  Color - color attribute for the box (integer).
  5801.  
  5802.              FrameType - frame type, an integer value from 0 to 11 as
  5803.                          follows, box frame 12 draws the user defined
  5804.                          frame:
  5805.  
  5806.                ╔═════════╗ ┌─────────┐ ╓─────────╖ ╒═════════╕  ╒════════╕
  5807.                ║ FRAME 0 ║ │ FRAME 1 │ ║ FRAME 2 ║ │ FRAME 3 │  │ FRAME 4│
  5808.                ╚═════════╝ └─────────┘ ╙─────────╜ ╘═════════╛  └────────┘
  5809.  
  5810.                            ▄▄▄▄▄▄▄▄▄▄  ░░░░░░░░░░░  ▒▒▒▒▒▒▒▒▒▒  ▓▓▓▓▓▓▓▓▓▓
  5811.                  FRAME 5   ▌ FRAME 6▐  ░ FRAME 7 ░  ▒FRAME 8 ▒  ▓FRAME 9 ▓
  5812.                            ▀▀▀▀▀▀▀▀▀▀  ░░░░░░░░░░░  ▒▒▒▒▒▒▒▒▒▒  ▓▓▓▓▓▓▓▓▓▓
  5813.  
  5814.                ██████████  **********
  5815.                █FRAME 10█  *FRAME 11*
  5816.                ██████████  **********
  5817.  
  5818.  
  5819.                                       Page -94-
  5820.  
  5821.  
  5822.  
  5823.  
  5824.  
  5825.                           SCL1 Version 2.0 Reference Manual
  5826.  
  5827.  
  5828.                                                                      GSSBox
  5829.  
  5830.              (Note: You will not be able to print the correct frame types
  5831.              if your printer does not support the IBM extended ASCII
  5832.              character set.)
  5833.  
  5834.               UpperRow - upper row coordinate of the box (integer).
  5835.  
  5836.                LeftCol - left column coordinate of the box (integer).
  5837.  
  5838.               LowerRow - lower row coordinate of the box (integer).
  5839.  
  5840.               RightCol - right column coordinate of the box (integer).
  5841.  
  5842.              (Note: the home position is row 0, column 0.)
  5843.  
  5844.  
  5845.                 GrowFl - flag to signal a growing box.  If this value is
  5846.                          "1" the box will grow from its center out.  If the
  5847.                          value is "0" the box will pop into the screen
  5848.                          (integer).
  5849.  
  5850.                SoundFl - flag to signal a noise growing box. If the value
  5851.                          is "1" when the box grows it will make a swirling
  5852.                          noise.  A value of "0" will draw a quiet box
  5853.                          (integer).
  5854.  
  5855.               ShadowFl - flag to signal a shadow effect.  If the value is
  5856.                          "1" a shadow effect will be drawn, if the value is
  5857.                          "0" no shadow effect will be drawn. The shadow
  5858.                          will be XOR'ed to the background, if no shadow
  5859.                          color have been defined (integer).
  5860.  
  5861.           Example:
  5862.  
  5863.           #include <scl1.h>
  5864.           #include <scl1clor.h>
  5865.  
  5866.           int Color1=WHITE_BLACK;
  5867.  
  5868.           main()
  5869.              {
  5870.              GSSBox(Color19,0,3,12,20,68,1,1,0);
  5871.              /* Will draw a growing, shadowed, double framed box between
  5872.                 rows 3 & 20 and columns 12 & 68 */
  5873.              }
  5874.  
  5875.           See also Box, Shadow, SetShadowColor, SetUserFrame.
  5876.  
  5877.  
  5878.                                       Page -95-
  5879.  
  5880.  
  5881.  
  5882.  
  5883.  
  5884.                           SCL1 Version 2.0 Reference Manual
  5885.  
  5886.  
  5887.                                                                   HideMouse
  5888.  
  5889.           Function:    HideMouse
  5890.  
  5891.           Purpose:     Hides or removes the mouse cursor from the screen.
  5892.  
  5893.           Declaration: void HideMouse(void);
  5894.  
  5895.           Returns:     Nothing
  5896.  
  5897.           Parameters:  None
  5898.  
  5899.           Example:
  5900.  
  5901.           #include <scl1.h>
  5902.  
  5903.           main()
  5904.              {
  5905.              InitMouse(IM_SHOW); /* initialize mouse, turn cursor on */
  5906.  
  5907.              if(MSE_MouseFl)
  5908.                 {
  5909.                 printf("We have a mouse, click the left button to turn
  5910.                         mouse cursor off.\n");
  5911.                 WaitKeyMouse();
  5912.                 HideMouse();
  5913.                 printf("Click again to turn mouse cursor on.\n");
  5914.                 WaitKeyMouse();
  5915.                 ShowMouse();
  5916.                 printf("Click to exit.\n");
  5917.                 WaitKeyMouse();
  5918.                 }
  5919.              else
  5920.                 printf("We don't have a mouse\n");
  5921.              }
  5922.           }
  5923.  
  5924.  
  5925.  
  5926.  
  5927.  
  5928.  
  5929.  
  5930.  
  5931.  
  5932.  
  5933.  
  5934.  
  5935.  
  5936.  
  5937.                                       Page -96-
  5938.  
  5939.  
  5940.  
  5941.  
  5942.  
  5943.                           SCL1 Version 2.0 Reference Manual
  5944.  
  5945.  
  5946.                                                                   InitMouse
  5947.  
  5948.           Function:    InitMouse
  5949.  
  5950.           Purpose:     Initializes the mouse for further use of the mouse
  5951.                        functions.  When you exit the program it takes care
  5952.                        of resetting the mouse.
  5953.  
  5954.           Declaration: int InitMouse(int Cursor);
  5955.  
  5956.           Returns:     Returns "-1" if an error has occurred that prevents
  5957.                        the function to initialize the mouse correctly.
  5958.  
  5959.           Parameters:
  5960.  
  5961.                 Cursor - this parameter tells InitMouse how to handle the
  5962.                          mouse cursor.  The following variables have been
  5963.                          defined in SCL1.H;
  5964.  
  5965.                            IM_SHOW - means to the show mouse cursor
  5966.                                      (integer).
  5967.  
  5968.                         IM_NO_SHOW - means not to show the mouse cursor
  5969.                                      (integer).
  5970.  
  5971.           Example:
  5972.  
  5973.           #include <scl1.h>
  5974.  
  5975.           main()
  5976.              {
  5977.              InitMouse(IM_SHOW); /* initialize mouse, turn cursor on */
  5978.  
  5979.              if(MSE_MouseFl)
  5980.                 {
  5981.                 printf("We have a mouse, click the left button to turn
  5982.                         mouse cursor off.\n");
  5983.                 WaitKeyMouse();
  5984.                 HideMouse();
  5985.                 printf("Click again to turn mouse cursor on.\n");
  5986.                 WaitKeyMouse();
  5987.                 ShowMouse();
  5988.                 printf("Click to exit.\n");
  5989.                 WaitKeyMouse();
  5990.                 }
  5991.              else
  5992.                 printf("We don't have a mouse\n");
  5993.              }
  5994.  
  5995.  
  5996.                                       Page -97-
  5997.  
  5998.  
  5999.  
  6000.  
  6001.  
  6002.                           SCL1 Version 2.0 Reference Manual
  6003.  
  6004.  
  6005.                                                               InitUserError
  6006.  
  6007.           Function:    InitUserError
  6008.  
  6009.           Purpose:     Initialize user defined error codes for use with the
  6010.                        ErrorBox function.  You can redefine the standard
  6011.                        error messages included in ErrorBox.
  6012.  
  6013.           Declaration: void InitUserError(struct ErrorMess *p);
  6014.  
  6015.           Returns:     Nothing
  6016.  
  6017.           Parameters:
  6018.  
  6019.           The Error Message information is placed in an array of structures
  6020.           as follows: (The array of structures must be terminated with a
  6021.           "0").
  6022.  
  6023.              struct ErrorMess{
  6024.                 int ErrorNum;
  6025.                 char *Message;
  6026.                 };
  6027.  
  6028.           where,
  6029.  
  6030.               ErrorNum - user defined error number, an integer value above
  6031.                          256 (integer).  If a predefined error message is
  6032.                          initialized, the function will use the new values. 
  6033.                          This permits to change the error messages.
  6034.  
  6035.                Message - pointer to the user defined error message's text.
  6036.  
  6037.  
  6038.           Example:
  6039.  
  6040.           #include <scl1.h>
  6041.  
  6042.           struct ErrorMess em[]={
  6043.              256,"Please type either Y for YES\nor N for NO",
  6044.              0};
  6045.  
  6046.           main()
  6047.              {
  6048.              int Key;
  6049.  
  6050.              InitUserError(em);
  6051.              printf("\nInstall printer driver? (Y/N)\n");
  6052.  
  6053.  
  6054.  
  6055.                                       Page -98-
  6056.  
  6057.  
  6058.  
  6059.  
  6060.  
  6061.                           SCL1 Version 2.0 Reference Manual
  6062.  
  6063.  
  6064.                                                               InitUserError
  6065.  
  6066.              do
  6067.                 {
  6068.                 Key=toupper(getch());
  6069.                 if(Key != 'Y' && Key != 'N')
  6070.                    ErrorBox(256);
  6071.                 else
  6072.                    break;
  6073.                 }while(1);
  6074.              }
  6075.  
  6076.           See also ErrorBox, ErrorShadowOff, ErrorShadowOn and
  6077.           SetErrorBoxColor.
  6078.  
  6079.  
  6080.  
  6081.  
  6082.  
  6083.  
  6084.  
  6085.  
  6086.  
  6087.  
  6088.  
  6089.  
  6090.  
  6091.  
  6092.  
  6093.  
  6094.  
  6095.  
  6096.  
  6097.  
  6098.  
  6099.  
  6100.  
  6101.  
  6102.  
  6103.  
  6104.  
  6105.  
  6106.  
  6107.  
  6108.  
  6109.  
  6110.  
  6111.  
  6112.  
  6113.  
  6114.                                       Page -99-
  6115.  
  6116.  
  6117.  
  6118.  
  6119.  
  6120.                           SCL1 Version 2.0 Reference Manual
  6121.  
  6122.  
  6123.                                                                   InitVideo
  6124.  
  6125.           Function:    InitVideo
  6126.  
  6127.           Purpose:     Initialize video monitor to the alphanumeric display
  6128.                        mode.
  6129.  
  6130.           Declaration: void InitVideo (void);
  6131.  
  6132.           Returns:     Nothing
  6133.  
  6134.           Parameters:  None
  6135.  
  6136.           Example:
  6137.  
  6138.           #include <scl1.h>
  6139.  
  6140.           main()
  6141.              {
  6142.              InitVideo();
  6143.              printf("SCL1's InitVideo function has initialized your
  6144.                      monitor\nto it's default alphanumeric mode.\n");
  6145.              }
  6146.  
  6147.  
  6148.  
  6149.  
  6150.  
  6151.  
  6152.  
  6153.  
  6154.  
  6155.  
  6156.  
  6157.  
  6158.  
  6159.  
  6160.  
  6161.  
  6162.  
  6163.  
  6164.  
  6165.  
  6166.  
  6167.  
  6168.  
  6169.  
  6170.  
  6171.  
  6172.  
  6173.                                      Page -100-
  6174.  
  6175.  
  6176.  
  6177.  
  6178.  
  6179.                           SCL1 Version 2.0 Reference Manual
  6180.  
  6181.  
  6182.                                                              Int24ShadowOff
  6183.                                                               Int24ShadowOn
  6184.  
  6185.           Function:    Int24ShadowOff
  6186.                        Int24ShadowOn
  6187.  
  6188.           Purpose:     Enable or disable a shadow effect when using the
  6189.                        TrapInt24 function.  After any of these functions is
  6190.                        called, all TrapInt24 messages will be displayed
  6191.                        with (or without) a shadow effect.
  6192.  
  6193.           Declaration: void Int24ShadowOff(void);
  6194.                        void Int24ShadowOn(void);
  6195.  
  6196.           Returns:     Nothing.
  6197.  
  6198.           Parameters:  None.
  6199.  
  6200.           Example:
  6201.  
  6202.  
  6203.              Int24ShadowOff(); /* Turn off shadow effect on error boxes */
  6204.              Int24ShadowOn();  /* Turn on shadow effect on error boxes  */
  6205.  
  6206.  
  6207.           See TrapInt24 and SetTrapInt24Colors.
  6208.  
  6209.  
  6210.  
  6211.  
  6212.  
  6213.  
  6214.  
  6215.  
  6216.  
  6217.  
  6218.  
  6219.  
  6220.  
  6221.  
  6222.  
  6223.  
  6224.  
  6225.  
  6226.  
  6227.  
  6228.  
  6229.  
  6230.  
  6231.  
  6232.                                      Page -101-
  6233.  
  6234.  
  6235.  
  6236.  
  6237.  
  6238.                           SCL1 Version 2.0 Reference Manual
  6239.  
  6240.  
  6241.                                                                    KeyReady
  6242.  
  6243.           Function:    KeyReady
  6244.  
  6245.           Purpose:     Scans the BIOS keyboard buffer for unprocessed
  6246.                        keystrokes.
  6247.  
  6248.           Declaration: unsigned int KeyReady(void);
  6249.  
  6250.           Returns:     Return the Scan/Ascii code of key in the BIOS buffer
  6251.                        or "0" if it is empty.
  6252.  
  6253.           Parameters:  None
  6254.  
  6255.           Example:
  6256.  
  6257.           #include <scl1.h>
  6258.  
  6259.           main()
  6260.              {
  6261.              while(!KeyReady())
  6262.                 printf("No key has been pressed!\n");
  6263.              ClearKeyBuf();
  6264.              }
  6265.  
  6266.  
  6267.  
  6268.  
  6269.  
  6270.  
  6271.  
  6272.  
  6273.  
  6274.  
  6275.  
  6276.  
  6277.  
  6278.  
  6279.  
  6280.  
  6281.  
  6282.  
  6283.  
  6284.  
  6285.  
  6286.  
  6287.  
  6288.  
  6289.  
  6290.  
  6291.                                      Page -102-
  6292.  
  6293.  
  6294.  
  6295.  
  6296.  
  6297.                           SCL1 Version 2.0 Reference Manual
  6298.  
  6299.  
  6300.                                                                   KeyStatus
  6301.  
  6302.           Function:    KeyStatus
  6303.  
  6304.           Purpose:     Returns the shift, control and toggle key status.
  6305.  
  6306.           Declaration: unsigned char KeyStatus(void);
  6307.  
  6308.           Returns:     The return value AND the following masks, defined in
  6309.                        SCL1.H, are ">0" if the key is toggled or pressed.
  6310.  
  6311.                        The mask values defined in SCL1.H are: INSERT,
  6312.                        CAPSL, NUMSL, SCROLL, ALT, CTRL, LSHIFT and RSHIFT.
  6313.  
  6314.           Example:
  6315.  
  6316.           #include <scl1.h>
  6317.           #include <scl1keys.h>
  6318.           #include <scl1clor.h>
  6319.  
  6320.           int Color1=BLACK_WHITE;
  6321.           int Color2=WHITE_BLACK;
  6322.  
  6323.           main()
  6324.              {
  6325.              unsigned int Key;
  6326.  
  6327.              Key=KeyStatus();
  6328.              if (Key&ALT)                    /* ALT key pressed */
  6329.                 WriteScreen(Color1,17,10,"Pressed    ");
  6330.              else
  6331.                 WriteScreen(Color2,17,10,"Not Pressed");
  6332.  
  6333.              if (Key&INSERT)                 /* INSERT mode is on */
  6334.                 WriteScreen(Color1,17,34,"On ");
  6335.              else
  6336.                 WriteScreen(Color2,17,34,"Off");
  6337.              }
  6338.  
  6339.  
  6340.  
  6341.  
  6342.  
  6343.  
  6344.  
  6345.  
  6346.  
  6347.  
  6348.  
  6349.  
  6350.                                      Page -103-
  6351.  
  6352.  
  6353.  
  6354.  
  6355.  
  6356.                           SCL1 Version 2.0 Reference Manual
  6357.  
  6358.  
  6359.                                                                  LineEditor
  6360.  
  6361.           Function:    LineEditor
  6362.  
  6363.           Purpose:     A full featured line editor.  You can define all the
  6364.                        parameters required for the line editor such as;
  6365.                        where to display a prompt, size of the field, size
  6366.                        of the display, colors, cursor size, default editing
  6367.                        mode, etc.
  6368.  
  6369.           Declaration: int LineEditor(int Message,LEData *p,...);
  6370.  
  6371.           Returns:     This is a dialog type function. See Appendix "E" for
  6372.                        a description of the general operation of these
  6373.                        functions.  The return value is a message described
  6374.                        in the Messages section.
  6375.  
  6376.           Parameters:
  6377.  
  6378.           The line editor information must be given in a structure defined
  6379.           as type LEData. The structure elements are as follows:
  6380.  
  6381.           typedef struct{
  6382.              int PColor;
  6383.              int PRow;
  6384.              int PCol;
  6385.              char *Prompt;
  6386.              int FColor;
  6387.              int FRow;
  6388.              int FCol;
  6389.              unsigned int FLength;
  6390.              unsigned int FSize;
  6391.              int CType;
  6392.              int MaskFn;
  6393.              char *MaskArray;
  6394.              char *Buffer;
  6395.              char *FormatC;
  6396.              unsigned int *ExitKeys;
  6397.              int InsFlag;
  6398.              int InsertCur;
  6399.              int TypeOverCur;
  6400.              int CPaint;
  6401.              unsigned int StartPos;
  6402.              unsigned int EndPos;
  6403.              unsigned int EventInfo;
  6404.              unsigned int Position;
  6405.              unsigned int Scroll;
  6406.              int Edited;
  6407.              }LEData;
  6408.  
  6409.                                      Page -104-
  6410.  
  6411.  
  6412.  
  6413.  
  6414.  
  6415.                           SCL1 Version 2.0 Reference Manual
  6416.  
  6417.  
  6418.                                                                  LineEditor
  6419.  
  6420.           where,
  6421.  
  6422.                 PColor - color attribute for the prompt (integer).
  6423.  
  6424.                    Row - row position where to display the for the prompt's
  6425.                          display (integer).
  6426.  
  6427.                   PCol - column position for the prompt's display
  6428.                          (integer).
  6429.  
  6430.                 Prompt - char pointer to the prompt.
  6431.  
  6432.                 FColor - color attribute for the field (integer).
  6433.  
  6434.                   FRow - row position for the field's display (integer).
  6435.  
  6436.                   FCol - column position for the field's display (integer).
  6437.  
  6438.                FLength - field's display length.  Number of characters to
  6439.                          display.  If the field size is larger than the
  6440.                          display size, the length of the display line for
  6441.                          the field (unsigned integer).
  6442.  
  6443.                 FSize -  maximum number of characters of the field. This
  6444.                          number can be larger than the field length, in
  6445.                          which case, the display will scroll horizontally
  6446.                          when the cursor reaches the end of the available
  6447.                          display length (unsigned integer).
  6448.  
  6449.                  CType - type of characters to be accepted. Please refer to 
  6450.                          CheckChar for a description of the values defined
  6451.                          in SCL1.H (integer).
  6452.  
  6453.                 MaskFn - a flag to instruct the function to accept or
  6454.                          discard the characters defined in the MaskArray
  6455.                          array.  A value of 0 will accept the characters
  6456.                          and a value of 1 will discard them (integer).
  6457.  
  6458.              MaskArray - array of mask characters (null terminated).
  6459.  
  6460.                 Buffer - buffer that holds the information to be edited.
  6461.  
  6462.                FormatC - a string that holds the characters to be used as
  6463.                          format characters during editing.
  6464.  
  6465.               ExitKeys - null terminated array of unsigned integer
  6466.                          Scan/Ascii values of the keys to exit.
  6467.  
  6468.                                      Page -105-
  6469.  
  6470.  
  6471.  
  6472.  
  6473.  
  6474.                           SCL1 Version 2.0 Reference Manual
  6475.  
  6476.  
  6477.                                                                  LineEditor
  6478.  
  6479.                InsFlag - a flag to instruct the function of the default
  6480.                          edit mode. ("1" = Insert,"0" = typeover)(integer).
  6481.  
  6482.              InsertCur - size of cursor when insert mode is toggled ("0" =
  6483.                          no cursor, "1" = normal cursor, "2" = block sized
  6484.                          cursor)(integer).
  6485.  
  6486.            TypeOverCur - size of cursor when typeover mode is toggled ("0"=
  6487.                          no cursor, "1" = normal cursor, "2" = block sized
  6488.                          cursor)(integer).
  6489.  
  6490.                 CPaint - color to be used to mark a group of characters
  6491.                          from the position defined by StartPos to EndPos.
  6492.                          The CPaint value can be used to construct
  6493.                          character blocks (integer).
  6494.  
  6495.               StartPos - start position of conditional paint characters
  6496.                          (unsigned integer).
  6497.  
  6498.                 EndPos - end position of conditional paint characters
  6499.                          (unsigned integer).
  6500.  
  6501.              EventInfo - information about the keys that have been pressed
  6502.                          (unsigned integer).
  6503.  
  6504.               Position - contains the current cursor position within the
  6505.                          buffer (or offset)(unsigned integer).
  6506.  
  6507.                 Scroll - horizontal scroll counter, keeps track of the
  6508.                          cursor position when the field size is larger than
  6509.                          the field length.
  6510.  
  6511.                 Edited - a flag that keeps track of the field activity.  A
  6512.                          value of "0" means that the field has not been
  6513.                          edited and a value of "1" means that the field has
  6514.                          been edited (integer).
  6515.  
  6516.  
  6517.  
  6518.  
  6519.  
  6520.  
  6521.  
  6522.  
  6523.  
  6524.  
  6525.  
  6526.  
  6527.                                      Page -106-
  6528.  
  6529.  
  6530.  
  6531.  
  6532.  
  6533.                           SCL1 Version 2.0 Reference Manual
  6534.  
  6535.  
  6536.                                                                  LineEditor
  6537.  
  6538.           Messages:
  6539.  
  6540.           Messages that can be sent to the LineEditor function:
  6541.  
  6542.                      LE_INIT - Initialize the LEData structure to NULL and
  6543.                                sets the following default values:
  6544.  
  6545.                             PColor - set to white characters in a black
  6546.                                      background or the normal color defined
  6547.                                      by calling SetDialogColors.
  6548.  
  6549.                             FColor - set to black characters in a white
  6550.                                      background or the reversed color
  6551.                                      defined by calling SetDialogColors.
  6552.  
  6553.                            FLength - set to 40 columns.
  6554.  
  6555.                              FSize - set to 40 columns.
  6556.  
  6557.                              CType - set to CC_ANY, accept any character.
  6558.  
  6559.                             Buffer - set to use a default internal buffer
  6560.                                      called DefBuf.
  6561.  
  6562.                           ExitKeys - set to the default exit keys.
  6563.  
  6564.                            InsFlag - set to the typeover mode.
  6565.  
  6566.                          InsertCur - set to a value of "2".
  6567.  
  6568.                      LE_DRAW - display the prompt and current edit buffer's
  6569.                                information.
  6570.  
  6571.              LE_UPDATE_FIELD - display the current edit buffer's contents.
  6572.  
  6573.  
  6574.  
  6575.  
  6576.  
  6577.  
  6578.  
  6579.  
  6580.  
  6581.  
  6582.  
  6583.  
  6584.  
  6585.  
  6586.                                      Page -107-
  6587.  
  6588.  
  6589.  
  6590.  
  6591.  
  6592.                           SCL1 Version 2.0 Reference Manual
  6593.  
  6594.  
  6595.                                                                  LineEditor
  6596.  
  6597.                    LE_ACTIVE - edit the contents of the field buffer. The
  6598.                                following edit keys have been defined:
  6599.  
  6600.                          Key                      Action
  6601.  
  6602.                        Left Arrow       cursor one position to the left.
  6603.                        Right Arrow      cursor one position to the right.
  6604.                        END              cursor to end of field.
  6605.                        HOME             cursor to beginning of field.
  6606.                        INSERT           toggle insert mode on/off.
  6607.                        BACKSPACE        erase the character at current
  6608.                                         cursor position. Move remaining
  6609.                                         text to the left.
  6610.  
  6611.                       LE_KEY - the parameter passed with this messages
  6612.                                (Scan+Ascii code of the key) is a control
  6613.                                key value that performs as if the control
  6614.                                key has been pressed.
  6615.  
  6616.                      LE_DATA - the parameter passed with this messages is
  6617.                                an ASCII key value that performs as if that
  6618.                                character has been typed.
  6619.  
  6620.            LE_POSITION_BEGIN - move cursor the start of the edit buffer.
  6621.  
  6622.              LE_POSITION_END - move cursor to the end of the edit buffer.
  6623.  
  6624.               LE_POSITION_UP - move cursor one position forward.
  6625.  
  6626.             LE_POSITION_DOWN - move cursor one position backwards.
  6627.  
  6628.              LE_SET_POSITION - set the cursor position.
  6629.  
  6630.                  LE_CHARS_UP - moves all the text from the current cursor
  6631.                                position one space forward.
  6632.  
  6633.                LE_CHARS_DOWN - moves all the text in the field from the
  6634.                                current cursor position one space backwards.
  6635.  
  6636.  
  6637.  
  6638.  
  6639.  
  6640.  
  6641.  
  6642.  
  6643.  
  6644.  
  6645.                                      Page -108-
  6646.  
  6647.  
  6648.  
  6649.  
  6650.  
  6651.                           SCL1 Version 2.0 Reference Manual
  6652.  
  6653.  
  6654.                                                                  LineEditor
  6655.  
  6656.                     LE_CLEAR - clear the editor's buffer.
  6657.  
  6658.                     LE_RESET - when this message is sent the field contents
  6659.                                variables are reset to the default value. 
  6660.                                If the exit keys have not been defined they
  6661.                                are set to the default exit keys.
  6662.  
  6663.           Messages that LineEditor can return:
  6664.  
  6665.                        LE_OK - the requested action has been successfully
  6666.                                performed.
  6667.  
  6668.                  LE_EXIT_KEY - a key defined as an exit key has been
  6669.                                pressed.
  6670.  
  6671.               LE_MOUSE_EVENT - the mouse has been clicked after pointing
  6672.                                outside the Line Editor field.
  6673.  
  6674.                LE_BUFFER_END - you have reached the buffer's maximum size.
  6675.  
  6676.              LE_BUFFER_BEGIN - you have reached the beginning of the edit
  6677.                                buffer.
  6678.  
  6679.               LE_ILLEGAL_KEY - a key that has not been defined as an exit
  6680.                                key or that is not a legal key as defined
  6681.                                for that field has been pressed.
  6682.  
  6683.               LE_BUFFER_FULL - the edit buffer is full.
  6684.  
  6685.           LE_ILLEGAL_POSITION- you have requested to move the cursor passed
  6686.                                the maximum defined field length or left of
  6687.                                the beginning position.
  6688.  
  6689.              LE_NEW_POSITION - a legal editing function is performed.
  6690.  
  6691.                  LE_MY_MOUSE - response to a LE_CHECK_MOUSE message if the
  6692.                                mouse has been clicked after pointing to the
  6693.                                field area defined by the function.
  6694.  
  6695.                  LE_DEL_NULL - you have pressed the delete key when the
  6696.                                cursor has reached the buffer end.
  6697.  
  6698.           Example:
  6699.  
  6700.           #include <scl1.h>
  6701.           #include <scl1keys.h>
  6702.           #include <scl1clor.h>
  6703.  
  6704.                                      Page -109-
  6705.  
  6706.  
  6707.  
  6708.  
  6709.  
  6710.                           SCL1 Version 2.0 Reference Manual
  6711.  
  6712.  
  6713.                                                                  LineEditor
  6714.  
  6715.           unsigned int ExitKeys[]={ENTER,ESC,0};
  6716.  
  6717.           main()
  6718.           {
  6719.           LEData led;
  6720.           int Mess;
  6721.           char buffer[81];
  6722.  
  6723.           Cls(WHITE_BLACK,CLS_ALL);               /* clear screen */
  6724.           memset(buffer,0,sizeof(buffer));        /* initialize buffer */
  6725.  
  6726.              /* initialize Line Editor structure */
  6727.  
  6728.           LineEditor(LE_INIT,&led);
  6729.  
  6730.              /* modify prompt and field position */
  6731.  
  6732.           led.PRow=led.FRow=12;
  6733.           led.PCol=25;
  6734.           led.FCol=35;
  6735.  
  6736.              /* the field's screen length is of 20 characters but up to
  6737.                 80 characters can be entered, the data entry field will
  6738.                 scroll automatically */
  6739.  
  6740.           led.FLength=20;
  6741.           led.FSize=80;
  6742.  
  6743.           led.Prompt="Filename:";            /* prompt */
  6744.           led.CType=CC_PATH | CC_CAPITALIZE; /* type of valid characters */
  6745.           led.Buffer=buffer;                 /* use our buffer */
  6746.           led.ExitKeys=ExitKeys;             /* our defined exit keys */
  6747.           PushCursor();                      /* save cursor */
  6748.           LineEditor(LE_DRAW,&led);          /* draw */
  6749.  
  6750.              /* Main loop: send ACTIVE message,
  6751.                 LineEditor constantly returns information */
  6752.           do
  6753.              {
  6754.              Mess=LineEditor(LE_ACTIVE,&led);
  6755.              if(Mess==LE_ILLEGAL_KEY)        /* illegal key? */
  6756.                 TSound(440,10);              /* beep */
  6757.  
  6758.              /* loop until an exit key is pressed */
  6759.              }while(Mess != LE_EXIT_KEY);
  6760.           PopCursor();
  6761.           }
  6762.  
  6763.                                      Page -110-
  6764.  
  6765.  
  6766.  
  6767.  
  6768.  
  6769.                           SCL1 Version 2.0 Reference Manual
  6770.  
  6771.  
  6772.                                                                 ListManager
  6773.  
  6774.           Function:    ListManager
  6775.  
  6776.           Purpose:     Displays a list of items and permits user selection
  6777.                        of items.  Mouse input is supported.
  6778.  
  6779.           Declaration: int ListManager(int NColor, int RColor,int Number,
  6780.                             int Length,int Selection, int Lines,
  6781.                             int Cols, struct ItemList*p);
  6782.  
  6783.           Returns:     The return value is the number of the selected item.
  6784.  
  6785.           Parameters:
  6786.  
  6787.           The Item List message information must be given as an array of
  6788.           structures as follows:
  6789.  
  6790.              struct ItemList{
  6791.                 int Row,Col;
  6792.                 char *String;
  6793.                 };
  6794.  
  6795.           where,
  6796.  
  6797.                    Row - row position of where to display the item
  6798.                          (integer).
  6799.  
  6800.                    Col - column position where to display the item
  6801.                          (integer).
  6802.  
  6803.                 String - char pointer to the item text to be displayed.
  6804.  
  6805.           The parameters passed to the function are:
  6806.  
  6807.                 NColor - color attribute for the normal display of items
  6808.                          (integer).
  6809.  
  6810.                 RColor - color attribute for the highlighted item
  6811.                          (integer).
  6812.  
  6813.                 Number - number of items defined (integer).
  6814.  
  6815.                 Length - length of the items (integer).
  6816.  
  6817.              Selection - default selection (integer).
  6818.  
  6819.                  Lines - number of lines to be displayed (integer).
  6820.  
  6821.  
  6822.                                      Page -111-
  6823.  
  6824.  
  6825.  
  6826.  
  6827.  
  6828.                           SCL1 Version 2.0 Reference Manual
  6829.  
  6830.  
  6831.                                                                 ListManager
  6832.  
  6833.                   Cols - number of columns to be displayed (integer).
  6834.  
  6835.               ItemList - pointer to the item list structure.
  6836.  
  6837.           Example:
  6838.  
  6839.  
  6840.           #include <scl1.h>
  6841.           #include <scl1clor.h>
  6842.  
  6843.           int Color1=BLACK_WHITE;
  6844.           int Color2=WHITE_BLACK;
  6845.  
  6846.           struct ItemList il[]={
  6847.              10,10,"Item #1",
  6848.              10,20,"Item #2",
  6849.              10,30,"Item #3",
  6850.              12,10,"Item #4",
  6851.              12,20,"Item #5",
  6852.              12,30,"Item #6",
  6853.              };
  6854.  
  6855.           main()
  6856.              {
  6857.              int ItemSelected;
  6858.  
  6859.              ItemSelected=ListManager(Color1,Color2,6,6,1,2,3,il);
  6860.              }
  6861.  
  6862.           See also ListWindow.
  6863.  
  6864.  
  6865.  
  6866.  
  6867.  
  6868.  
  6869.  
  6870.  
  6871.  
  6872.  
  6873.  
  6874.  
  6875.  
  6876.  
  6877.  
  6878.  
  6879.  
  6880.  
  6881.                                      Page -112-
  6882.  
  6883.  
  6884.  
  6885.  
  6886.  
  6887.                           SCL1 Version 2.0 Reference Manual
  6888.  
  6889.  
  6890.                                                                  ListWindow
  6891.  
  6892.           Function:    ListWindow
  6893.  
  6894.           Purpose:     Displays an array of items in a window in columnar
  6895.                        format.  The user can use the arrow keys or the
  6896.                        mouse to tag or select a desired item.  When the
  6897.                        list of items is large, the function displays scroll
  6898.                        bars to let the user know that there are items not
  6899.                        shown in the window.
  6900.  
  6901.           Declaration: int ListWindow(int Message,LWData *p,...);
  6902.  
  6903.           Returns:     This is a dialog type function. See Appendix "E" for
  6904.                        a description of the general operation of these
  6905.                        functions.  The return value is a message described
  6906.                        in the Messages section.
  6907.  
  6908.           Parameters:
  6909.  
  6910.           The list window information must be given in a structure defined
  6911.           as type LWData. The structure elements are as follows:
  6912.  
  6913.           LWData structure:
  6914.  
  6915.           typedef struct{
  6916.              int NColor;
  6917.              int RColor;
  6918.              int UpperRow;
  6919.              int LeftCol;
  6920.              int LowerRow;
  6921.              int RightCol;
  6922.              int FrameType;
  6923.              int ScrollBar;
  6924.              int BarColor;
  6925.              char **Array;
  6926.              char *TagArray;
  6927.              int TagColor;
  6928.              char *Title;
  6929.              int TitleColor;
  6930.              unsigned int *ExitKeys;
  6931.              int StaticWidth;
  6932.              unsigned int Items;
  6933.              unsigned int ColumnWidth;
  6934.              unsigned int FirstItem;
  6935.              unsigned int Position;
  6936.              unsigned int *ExitKeys;
  6937.              int WindowLines;
  6938.              int WindowCols;
  6939.  
  6940.                                      Page -113-
  6941.  
  6942.  
  6943.  
  6944.  
  6945.  
  6946.                           SCL1 Version 2.0 Reference Manual
  6947.  
  6948.  
  6949.                                                                  ListWindow
  6950.  
  6951.              int TotalCols;
  6952.              int TotalWindowItems;
  6953.              int OldHBlock;
  6954.              unsigned int EventInfo;
  6955.              }LWData;
  6956.  
  6957.           where,
  6958.  
  6959.                       NColor - color attribute for normal display
  6960.                                (integer).
  6961.  
  6962.                       RColor - color attributes for reversed display
  6963.                                (integer).
  6964.  
  6965.                     UpperRow - upper row coordinate of the window
  6966.                                (integer).
  6967.  
  6968.                      LeftCol - left column coordinate of the window
  6969.                                (integer).
  6970.  
  6971.                     LowerRow - lower row coordinate of the window
  6972.                                (integer).
  6973.  
  6974.                     RightCol - right column coordinate of the window
  6975.                                (integer).
  6976.  
  6977.                    FrameType - any of the frame types that can be used with
  6978.                                the Box or GSSbox functions (integer).
  6979.  
  6980.                    ScrollBar - a flag to signal the function to draw scroll
  6981.                                bars at the bottom of the display to
  6982.                                indicate the relative position of the cursor
  6983.                                (integer).
  6984.  
  6985.                     BarColor - color attributes for the scroll bars
  6986.                                (integer).
  6987.  
  6988.                        Array - pointer to a null terminated array of
  6989.                                pointers to be displayed.
  6990.  
  6991.                     TagArray - an array that holds which item has been
  6992.                                tagged.  If a null pointer is specified the
  6993.                                function will not permit tagging.  An array
  6994.                                element value of "0" and "1"  indicate the
  6995.                                status for untagged and tagged (char).
  6996.  
  6997.  
  6998.  
  6999.                                      Page -114-
  7000.  
  7001.  
  7002.  
  7003.  
  7004.  
  7005.                           SCL1 Version 2.0 Reference Manual
  7006.  
  7007.  
  7008.                                                                  ListWindow
  7009.  
  7010.                     TagColor - color attributes to be used for displaying a
  7011.                                tagged item (integer).
  7012.  
  7013.                        Title - char pointer to text to be displayed in the
  7014.                                window's top row as a title.
  7015.  
  7016.                   TitleColor - color attributes for the title's display
  7017.                                (integer).
  7018.  
  7019.                     ExitKeys - an array of keys defined to exit the
  7020.                                function (unsigned integer).
  7021.  
  7022.                  StaticWidth - a value of "0" means that the number of
  7023.                                columns will be determined by the maximum
  7024.                                length of any of the items, a value of "1"
  7025.                                sets the width of the columns to the value
  7026.                                defined with ColumnWidth (integer).
  7027.  
  7028.                        Items - structure element (used internally) that
  7029.                                holds the quantity of items in the array
  7030.                                (unsigned integer).
  7031.  
  7032.                  ColumnWidth - width of each column to be displayed window
  7033.                                (unsigned integer).
  7034.  
  7035.                    FirstItem - structure element (used internally) that
  7036.                                holds the position of the first array
  7037.                                element (unsigned integer).
  7038.  
  7039.                     Position - structure element (used internally) that
  7040.                                holds the active position of the display
  7041.                                (unsigned integer).  Note this element
  7042.                                should not be modified by the calling
  7043.                                program but can be read.
  7044.  
  7045.                  WindowLines - structure element (used internally) that
  7046.                                holds the number of lines in the List Window
  7047.                                (integer).
  7048.  
  7049.                   WindowCols - structure element (used internally) that
  7050.                                holds the number of columns in the List
  7051.                                Window (integer).
  7052.  
  7053.                    TotalCols - structure element (used internally) that
  7054.                                holds the maximum number of columns in the
  7055.                                window (integer).
  7056.  
  7057.  
  7058.                                      Page -115-
  7059.  
  7060.  
  7061.  
  7062.  
  7063.  
  7064.                           SCL1 Version 2.0 Reference Manual
  7065.  
  7066.  
  7067.                                                                  ListWindow
  7068.  
  7069.             TotalWindowItems - structure element (used internally) that
  7070.                                holds the number of items (integer).
  7071.  
  7072.                    OldHBlock - structure element (used internally) that
  7073.                                holds the position of the relative position
  7074.                                indicating scroll bar block (integer).
  7075.  
  7076.                    EventInfo - information about the keys that have been
  7077.                                pressed (unsigned integer).
  7078.  
  7079.           Messages:
  7080.  
  7081.           The following messages can be sent to ListWindow:
  7082.  
  7083.                         LW_INIT - initialize the LWData structure to NULL
  7084.                                   and set the following default values:
  7085.  
  7086.                             NColor - set to white characters in a black
  7087.                                      background or the normal color defined
  7088.                                      by calling SetDialogColors.
  7089.  
  7090.                             RColor - set to black characters in a white
  7091.                                      background or the reversed color
  7092.                                      defined by calling SetDialogColors.
  7093.  
  7094.                           LowerRow - one row less than the screen length.
  7095.  
  7096.                           RightCol - one column less than the screen width.
  7097.  
  7098.                          FrameType - set to frame type "1" (single line).
  7099.  
  7100.                          ScrollBar - set to draw scroll bars.
  7101.  
  7102.                           BarColor - set to black characters in a white
  7103.                                      background or the reversed color
  7104.                                      defined by calling SetDialogColors.
  7105.  
  7106.                           TagColor - set to black characters in a white
  7107.                                      background or the reversed color
  7108.                                      defined by calling SetDialogColors.
  7109.  
  7110.                         TitleColor - set to white characters in a black
  7111.                                      background or the normal color defined
  7112.                                      by calling SetDialogColors.
  7113.  
  7114.                          OldHBlock - set to "-1".
  7115.  
  7116.  
  7117.                                      Page -116-
  7118.  
  7119.  
  7120.  
  7121.  
  7122.  
  7123.                           SCL1 Version 2.0 Reference Manual
  7124.  
  7125.  
  7126.                                                                  ListWindow
  7127.  
  7128.                         LW_DRAW - display the list window.
  7129.  
  7130.                        LW_WRITE - draws the window and the list of items to
  7131.                                   the screen.
  7132.  
  7133.                       LW_ACTIVE - browse through the displayed items and
  7134.                                   permit the selection or tagging of them
  7135.                                   using the cursor movement keys as
  7136.                                   follows:
  7137.  
  7138.                          Key                      action
  7139.  
  7140.                        Up Arrow         cursor one item up.
  7141.                        Down Arrow       cursor one item down.
  7142.                        Left Arrow       cursor one item to the left.
  7143.                        Right Arrow      cursor one item to the right.
  7144.                        END              cursor to end of list.
  7145.                        HOME             cursor to beginning of list.
  7146.                        Page Up          cursor one screen up.
  7147.                        Page Down        cursor one screen down.
  7148.  
  7149.                  LW_DRAW_BORDER - draw the List Window's border.
  7150.  
  7151.               LW_POSITION_BEGIN - move cursor to the first item.
  7152.  
  7153.                 LW_POSITION_END - move cursor to the last item.
  7154.  
  7155.                  LW_POSITION_UP - move cursor to the previous item.
  7156.  
  7157.                LW_POSITION_DOWN - move cursor to the next item.
  7158.  
  7159.                 LW_SET_POSITION - move cursor to a specific item.  The item
  7160.                                   number is passed as a parameter.
  7161.  
  7162.                          LW_CLS - clear the list window data area.
  7163.  
  7164.                  LW_CHECK_MOUSE - check if the mouse has been clicked after
  7165.                                   pointing to the area defined by the
  7166.                                   function.
  7167.  
  7168.                        LW_RESET - when this message is sent the position
  7169.                                   variables are reset to the default value. 
  7170.                                   If the exit keys have not been defined
  7171.                                   they are set to the default exit keys.
  7172.  
  7173.  
  7174.  
  7175.  
  7176.                                      Page -117-
  7177.  
  7178.  
  7179.  
  7180.  
  7181.  
  7182.                           SCL1 Version 2.0 Reference Manual
  7183.  
  7184.  
  7185.                                                                  ListWindow
  7186.  
  7187.           The following messages can be returned by ListWindow:
  7188.  
  7189.                   LW_NULL_ARRAY - no item array has been defined.
  7190.  
  7191.                           LW_OK - the requested action has been performed.
  7192.  
  7193.                     LW_EXIT_KEY - a key that has been defined as an exit
  7194.                                   key has been pressed.
  7195.  
  7196.                  LW_MOUSE_EVENT - the mouse has been clicked but it has not
  7197.                                   been pointed to the area defined by the
  7198.                                   function.
  7199.  
  7200.                   LW_BUFFER_END - you have requested to move the cursor
  7201.                                   passed the last item.
  7202.  
  7203.                 LW_BUFFER_BEGIN - you have requested to move the cursor up
  7204.                                   passed the first active item.
  7205.  
  7206.                  LW_ILLEGAL_KEY - a key that has not been defined has been
  7207.                                   pressed.
  7208.  
  7209.             LW_ILLEGAL_POSITION - you have requested to move the cursor to
  7210.                                   an invalid position.
  7211.  
  7212.                 LW_NEW_POSITION - the cursor position has been updated.
  7213.  
  7214.                 LW_MOUSE_SELECT - one of the elements have been selected by
  7215.                                   double clicking the mouse.
  7216.  
  7217.                     LW_MY_MOUSE - response to a LW_CHECK_MOUSE message if
  7218.                                   the mouse has been clicked after pointing
  7219.                                   to the field area defined by the
  7220.                                   function.
  7221.  
  7222.                 LW_NEW_MOUSEPOS - you have moved the cursor by clicking the
  7223.                                   mouse after pointing to an item.
  7224.  
  7225.                   LW_BLOCK_MARK - you have tagged a group of items using
  7226.                                   your mouse.
  7227.  
  7228.  
  7229.  
  7230.  
  7231.  
  7232.  
  7233.  
  7234.  
  7235.                                      Page -118-
  7236.  
  7237.  
  7238.  
  7239.  
  7240.  
  7241.                           SCL1 Version 2.0 Reference Manual
  7242.  
  7243.  
  7244.                                                                  ListWindow
  7245.  
  7246.           Example:
  7247.  
  7248.           #include <scl1.h>
  7249.           #include <scl1clor.h>
  7250.  
  7251.           char *Items[]={   /* Array of items to display */
  7252.               "11111",
  7253.               "22222",
  7254.               "33333",
  7255.               "44444",
  7256.               "55555",
  7257.               "66666",
  7258.               "77777",
  7259.               "88888",
  7260.               "99999",
  7261.               "00000",
  7262.               0,            /* terminated with a "0" */
  7263.               };
  7264.  
  7265.           char TagA[10];
  7266.  
  7267.           int Color1=BLACK_WHITE;
  7268.           int Color2=WHITE_BLACK;
  7269.  
  7270.           main()
  7271.           {
  7272.           int EMess;
  7273.           LWData lw;        /* set lw as type LWData */
  7274.  
  7275.           ListWindow(LW_INIT,&lw);
  7276.           lw.UpperRow=5;             /* Set window size */
  7277.           lw.LowerRow=10;
  7278.           lw.LeftCol=30;
  7279.           lw.RightCol=40;
  7280.           lw.RColor=Color2;
  7281.           lw.TagArray=TagA;
  7282.           lw.Array=Items;
  7283.           ListWindow(LW_DRAW,&lw);
  7284.           do
  7285.               {
  7286.               EMess=ListWindow(LW_ACTIVE,&lw);
  7287.               }while(EMess != LW_EXIT_KEY);
  7288.           }
  7289.  
  7290.  
  7291.  
  7292.  
  7293.  
  7294.                                      Page -119-
  7295.  
  7296.  
  7297.  
  7298.  
  7299.  
  7300.                           SCL1 Version 2.0 Reference Manual
  7301.  
  7302.  
  7303.                                                                     MakeDir
  7304.  
  7305.           Function:    MakeDir
  7306.  
  7307.           Purpose:     Creates a new directory.
  7308.  
  7309.           Declaration: int MakeDir(char *Path);
  7310.  
  7311.           Returns:     The return value is "0" if no error occurs or the
  7312.                        DOS error code if an error occurs.  (See Appendix
  7313.                        "A", FILE FUNCTIONS, for more information).
  7314.  
  7315.           Parameters:
  7316.  
  7317.                   Path - char pointer to a string holding the new directory
  7318.                          name.
  7319.  
  7320.           Example:
  7321.  
  7322.           #include <scl1.h>
  7323.  
  7324.           main()
  7325.              {
  7326.              MakeDir("SCL1");
  7327.              }
  7328.  
  7329.  
  7330.  
  7331.  
  7332.  
  7333.  
  7334.  
  7335.  
  7336.  
  7337.  
  7338.  
  7339.  
  7340.  
  7341.  
  7342.  
  7343.  
  7344.  
  7345.  
  7346.  
  7347.  
  7348.  
  7349.  
  7350.  
  7351.  
  7352.  
  7353.                                      Page -120-
  7354.  
  7355.  
  7356.  
  7357.  
  7358.  
  7359.                           SCL1 Version 2.0 Reference Manual
  7360.  
  7361.  
  7362.                                                                        Menu
  7363.  
  7364.           Function:    Menu
  7365.  
  7366.           Purpose:     Displays a scrolling or moving bar type menu.  A
  7367.                        selection is made by either pressing the highlighted
  7368.                        menu option letter or by scrolling the highlighted
  7369.                        bar using the arrow keys and then pressing the ENTER
  7370.                        (RETURN) key.  This function permits full control of
  7371.                        the menu's appearance, size and position.  The menu
  7372.                        items can be placed anywhere in the screen and in
  7373.                        any desired order, you are not limited to placing
  7374.                        all the menu options in successive lines.
  7375.  
  7376.           Declaration: int Menu(int NColor, int RColor, int HColor,
  7377.                            int NumOpt, struct MenuOpt *mo);
  7378.  
  7379.  
  7380.           Returns:     The highlighted selection number (>0) or -1 if ESC
  7381.                        is pressed.
  7382.  
  7383.           Parameters:
  7384.  
  7385.           The menu information must be entered as an array of structures as
  7386.           follows; with one array element for each menu option:
  7387.  
  7388.              struct MenuOpt{
  7389.                 int Row,Col;
  7390.                 char *String;
  7391.                 char Letter;
  7392.                 };
  7393.  
  7394.           where:
  7395.  
  7396.                    Row - row position for the menu item (integer).
  7397.  
  7398.                    Col - column position for the menu item (integer).
  7399.  
  7400.                 String - pointer to the menu item text.
  7401.  
  7402.                 Letter - letter to be highlighted for fast keyboard
  7403.                          selection of the menu item (char).
  7404.  
  7405.  
  7406.  
  7407.  
  7408.  
  7409.  
  7410.  
  7411.  
  7412.                                      Page -121-
  7413.  
  7414.  
  7415.  
  7416.  
  7417.  
  7418.                           SCL1 Version 2.0 Reference Manual
  7419.  
  7420.  
  7421.                                                                        Menu
  7422.  
  7423.           The parameters passed to the function are:
  7424.  
  7425.                 NColor - color attribute for the menu background and
  7426.                          foreground (integer).
  7427.  
  7428.                 RColor - color attribute for the highlighted item menu bar
  7429.                          (integer).
  7430.  
  7431.                 HColor - color attribute for the highlighted quick
  7432.                          selection menu item letter (integer).
  7433.  
  7434.                 NumOpt - number of menu options (integer).
  7435.  
  7436.                MenuOpt - pointer to the menu structure previously defined.
  7437.  
  7438.           Example:
  7439.  
  7440.           #include <scl1.h>
  7441.           #include <scl1clor.h>
  7442.  
  7443.           struct MenuOpt Mainmenu[7]={  /*Array of structures with seven
  7444.                                           elements */
  7445.               5,24,"Screen Related Functions    ",'S', /* First option   */
  7446.               7,24,"Keyboard Handling Functions ",'K', /* Second option  */
  7447.               9,24,"Mouse Handling Functions    ",'M', /* Third option   */
  7448.              11,24,"Program Flow Functions      ",'P', /* Fourth option  */
  7449.              13,24,"File Handling Functions     ",'F', /* Fifth option   */
  7450.              15,24,"Background and Miscellaneous",'B', /* Sixth option   */
  7451.              17,24,"Exit Demo                   ",'E', /* Seventh option */
  7452.                 };
  7453.  
  7454.           int Color1=BLACK_WHITE;
  7455.           int Color2=WHITE_BLACK;
  7456.           int Color3=BLACK_WHITE+HIGHLIGHT;
  7457.  
  7458.           main()
  7459.              {
  7460.              int Selection;
  7461.              Box(Color1,5,1,5,18,25); /* Box for menu */
  7462.              WriteScreen(Color1,2,11,"FUNCTIONS"); /* Menu title */
  7463.              Selection=Menu(Color1,Color2,Color3,7,Mainmenu);
  7464.              }
  7465.  
  7466.  
  7467.  
  7468.  
  7469.  
  7470.  
  7471.                                      Page -122-
  7472.  
  7473.  
  7474.  
  7475.  
  7476.  
  7477.                           SCL1 Version 2.0 Reference Manual
  7478.  
  7479.  
  7480.                                                                     MenuSys
  7481.  
  7482.           Function:    MenuSys    (OBSOLETE, use the MenuSystem function,
  7483.                                   this function will eventually be removed
  7484.                                   from future versions of SCL1.)
  7485.  
  7486.           Purpose:     Displays a pull-down menu system in the top of the
  7487.                        screen.  The number of pull-down menus is defined by
  7488.                        the programmer.  All the pull-down menus perform and
  7489.                        are defined as for the Menu function.  The function
  7490.                        requires the programmer to define various structures
  7491.                        and data blocks, although this approach seems to be
  7492.                        complex it gives full control of the size, position
  7493.                        and appearance of the menu.  Supports mouse control.
  7494.  
  7495.           Declaration: int MenuSys(int NColor,int RColor,int HColor,
  7496.                                    int MenuNumber,struct BarMenu *bm,
  7497.                                    struct MenuSysData *msd);
  7498.  
  7499.           Returns:     Return value is the highlighted selection number,
  7500.                        "-1" if the ESC key is pressed or "0" if no
  7501.                        selection is made.  The function returns two digits,
  7502.                        the first corresponding to the pull-down menu number
  7503.                        and the second corresponding to the option selected
  7504.                        in that menu.  The calling program must create a
  7505.                        loop for calling the function when required.
  7506.  
  7507.           Parameters:
  7508.  
  7509.           The menu information must be given as an array of structures as
  7510.           follows:
  7511.  
  7512.              1. Define the Top Row menu information as follows, one element
  7513.                 for each of the main options:
  7514.  
  7515.                 struct BarMenu{
  7516.                    int StartCol,EndCol;
  7517.                    char String[20];
  7518.                    };
  7519.  
  7520.              where;
  7521.  
  7522.               StartCol - column position of the first character of the
  7523.                          option's prompt (integer).
  7524.  
  7525.                 EndCol - column position of the last character of the
  7526.                          option's prompt (integer).
  7527.  
  7528.  
  7529.  
  7530.                                      Page -123-
  7531.  
  7532.  
  7533.  
  7534.  
  7535.  
  7536.                           SCL1 Version 2.0 Reference Manual
  7537.  
  7538.  
  7539.                                                                     MenuSys
  7540.  
  7541.                 String - pointer to a string value containing the option's
  7542.                          prompt, equal to or shorter than 19 characters
  7543.                          (char).
  7544.  
  7545.              Note: The StartCol and EndCol information is used by MenuSys
  7546.                    to determine the mouse range for that option and to
  7547.                    highlight it when selected, for proper operation make
  7548.                    sure that options do not overlap.
  7549.  
  7550.              2. Define one MenuOpt structure for each of the pull-down
  7551.                 menus.  This structure is identical to that used by the
  7552.                 Menu and MouseMenu functions:
  7553.  
  7554.                 struct MenuOpt{
  7555.                    int Row,Col;
  7556.                    char *String;
  7557.                    char Letter;
  7558.                    };
  7559.  
  7560.              where:
  7561.  
  7562.                MenuOpt - name or reference to the menu.
  7563.  
  7564.                    Row - row position for the menu item (integer).
  7565.  
  7566.                    Col - column position for the menu item (integer).
  7567.  
  7568.                 String - pointer to the menu item text (char).
  7569.  
  7570.                 Letter - letter to be highlighted for fast keyboard
  7571.                          selection of the menu item (char).
  7572.  
  7573.           3. Define a PopMenuData structure for each of the pull-down menus
  7574.              as follows:
  7575.  
  7576.                 struct PopMenuData{
  7577.                    int L1,C1,L2,C2;
  7578.                    int NumberOption;
  7579.                    char *WinBuffer;
  7580.                    struct MenuOpt *Menust;
  7581.                    };
  7582.  
  7583.              where;
  7584.  
  7585.                        L1 - upper left row coordinate of the box used to
  7586.                             enclose the pull-down menu (integer).
  7587.  
  7588.  
  7589.                                      Page -124-
  7590.  
  7591.  
  7592.  
  7593.  
  7594.  
  7595.                           SCL1 Version 2.0 Reference Manual
  7596.  
  7597.  
  7598.                                                                     MenuSys
  7599.  
  7600.                        C1 - upper left column coordinate of the box
  7601.                             (integer).
  7602.  
  7603.                        L2 - lower right row coordinate of the box
  7604.                             (integer).
  7605.  
  7606.                        C2 - lower right column coordinate of the box
  7607.                             (integer).
  7608.  
  7609.             NumberOptions - number of options of the pull-down menu
  7610.                             (integer).
  7611.  
  7612.                 WinBuffer - buffer to store the screen area used when
  7613.                             popping out the pull-down menu (char).
  7614.  
  7615.                   MenuOpt - pointer to the MenuOption structure
  7616.                             corresponding to that pull-down menu.
  7617.  
  7618.           4. Define a MenuSysData structure with one element for each of
  7619.              the pull-down menus as follows:
  7620.  
  7621.                 struct MenuSysData{
  7622.                    unsigned int Key;
  7623.                    struct PopMenuData *PMenu;
  7624.                    };
  7625.  
  7626.              where;
  7627.  
  7628.                       Key - key to activate that pull-down menu. (required
  7629.                             for keyboard control of the menu system)
  7630.                             (unsigned integer).
  7631.  
  7632.               PopMenuData - pointer to the PopMenuData structure.
  7633.  
  7634.           The MenuSys function is called with the following parameters:
  7635.  
  7636.                 NColor - color attribute of the menus (integer).
  7637.  
  7638.                 RColor - reverse color attributes (integer).
  7639.  
  7640.                 HColor - highlight color attributes (integer).
  7641.  
  7642.             MenuNumber - number of pull-down menus (integer).
  7643.  
  7644.                BarMenu - pointer to the BarMenu structure.
  7645.  
  7646.            MenuSysData - pointer to the MenuSysData structure.
  7647.  
  7648.                                      Page -125-
  7649.  
  7650.  
  7651.  
  7652.  
  7653.  
  7654.                           SCL1 Version 2.0 Reference Manual
  7655.  
  7656.  
  7657.                                                                     MenuSys
  7658.  
  7659.           Example:
  7660.  
  7661.           #include <scl1.h>
  7662.           #include <scl1clor.h>
  7663.           #include <scl1keys.h>
  7664.  
  7665.           int Color1=BLACK_WHITE;
  7666.           int Color2=WHITE_BLACK;
  7667.           int Color3=BLACK_WHITE+HIGHLIGHT;
  7668.  
  7669.           /* Bar Menu Structure */
  7670.           struct BarMenu bd[]={
  7671.              3,9,"F1 File",
  7672.              17,23,"F2 Edit",
  7673.              };
  7674.  
  7675.           /* First pop-menu structure */
  7676.           struct MenuOpt Men1[]={
  7677.              2,5,"New    ",'N',
  7678.              3,5,"Open   ",'O',
  7679.              4,5,"Close  ",'C',
  7680.              5,5,"Save   ",'S',
  7681.              6,5,"Exit   ",'E',
  7682.              };
  7683.  
  7684.           /* Second pop-menu structure */
  7685.           struct MenuOpt Men2[]={
  7686.              2,19,"Copy   ",'C',
  7687.              3,19,"Delete ",'D',
  7688.              4,19,"Insert ",'I',
  7689.              5,19,"Cancel ",'a'};
  7690.  
  7691.           struct PopMenuData bd1[]={
  7692.              1,3,7,13,
  7693.              5,
  7694.              WinBuf1,
  7695.              Men1,
  7696.  
  7697.              1,17,6,27,
  7698.              4,
  7699.              WinBuf1,
  7700.              Men2,
  7701.              };
  7702.  
  7703.  
  7704.  
  7705.  
  7706.  
  7707.                                      Page -126-
  7708.  
  7709.  
  7710.  
  7711.  
  7712.  
  7713.                           SCL1 Version 2.0 Reference Manual
  7714.  
  7715.  
  7716.                                                                     MenuSys
  7717.  
  7718.           struct MenuSysData msd1[]={
  7719.              F1,
  7720.              &bd1[0],
  7721.  
  7722.              F2,
  7723.              &bd1[1],
  7724.              };
  7725.  
  7726.           main()
  7727.              {
  7728.              int Selection;
  7729.              /* Draws the top row prompts*/
  7730.              DrawBarMenu(Color1,Color2,2,0,bd);
  7731.  
  7732.              /* Loop until the exit option is selected */
  7733.              do
  7734.                 {
  7735.                 Selection=MenuSys(Color1,Color2,Color3,2,bd,msd1);
  7736.  
  7737.                 /* Discard any invalid key pressed */
  7738.                 if(!((KeyReady()>F1)&&(KeyReady()<F4)))
  7739.                      ClearKeyBuf();
  7740.                 }while((Selection==0)||(Selection!=15));
  7741.              }
  7742.           In the above example the exit option is the fifth of the first
  7743.           pull-down menu.
  7744.  
  7745.  
  7746.  
  7747.  
  7748.  
  7749.  
  7750.  
  7751.  
  7752.  
  7753.  
  7754.  
  7755.  
  7756.  
  7757.  
  7758.  
  7759.  
  7760.  
  7761.  
  7762.  
  7763.  
  7764.  
  7765.  
  7766.                                      Page -127-
  7767.  
  7768.  
  7769.  
  7770.  
  7771.  
  7772.                           SCL1 Version 2.0 Reference Manual
  7773.  
  7774.  
  7775.                                                                  MenuSystem
  7776.  
  7777.           Function:    MenuSystem
  7778.  
  7779.           Purpose:     Displays a pull-down menu system in the top of the
  7780.                        screen. The function requires the programmer to
  7781.                        define various structures and data blocks, although
  7782.                        this approach seems to be complex it gives full
  7783.                        control of the size, position and appearance of the
  7784.                        menu.  Supports mouse control.  This is a dialog
  7785.                        type function.
  7786.  
  7787.           Declaration: int MenuSystem(int Message,MSData *msd,...);
  7788.  
  7789.           Returns:     This is a dialog type function. See Appendix "E" for
  7790.                        a description of the general operation of these
  7791.                        functions. The return value is a message described
  7792.                        in the Messages section.
  7793.  
  7794.           Parameters:
  7795.  
  7796.           The menu information must be given in an array of structures as
  7797.           follows; one element for each pull-down menu:
  7798.  
  7799.           1. The top row menu information is defined as an array of
  7800.              structures type MSBar as follows, one element for each of the
  7801.              main options:
  7802.  
  7803.              typedef struct{
  7804.                 int StartCol;
  7805.                 int EndCol;
  7806.                 unsigned int Key;
  7807.                 char *String;
  7808.                 }MSBar;
  7809.  
  7810.           where;
  7811.  
  7812.               StartCol - column position of the first character of the
  7813.                          option's prompt (integer).
  7814.  
  7815.                 EndCol - column position of the last character of the
  7816.                          option's prompt (integer).
  7817.  
  7818.                    Key - unsigned integer structure member that indicates
  7819.                          which key will be used to call the pull-down menu.
  7820.                          (This is important when using keyboard input).
  7821.  
  7822.  
  7823.  
  7824.  
  7825.                                      Page -128-
  7826.  
  7827.  
  7828.  
  7829.  
  7830.  
  7831.                           SCL1 Version 2.0 Reference Manual
  7832.  
  7833.  
  7834.                                                                  MenuSystem
  7835.  
  7836.                 String - pointer to a string value containing the option's
  7837.                          prompt.
  7838.  
  7839.              Note: The StartCol and EndCol information is used by
  7840.                    MenuSystem to determine the mouse range for that option
  7841.                    and to highlight it when selected.  For proper operation
  7842.                    make sure that options do not overlap.
  7843.  
  7844.           2. Each pull-down menu is defined as an array of structures type
  7845.              MSOptions.  The structure is similar to that used for the Menu
  7846.              function.
  7847.  
  7848.              typedef struct{
  7849.                 int Row;
  7850.                 int Col;
  7851.                 char *String;
  7852.                 char Letter;
  7853.                 }MSOptions;
  7854.  
  7855.              where:
  7856.  
  7857.                    Row - row position for the menu item (integer).
  7858.  
  7859.                    Col - column position for the menu item (integer).
  7860.  
  7861.                 String - pointer to the menu item text.
  7862.  
  7863.                 Letter - letter to be highlighted for fast keyboard
  7864.                          selection of the menu item (char).
  7865.  
  7866.           3. The pull down menu box information is defined in a structure
  7867.              type MSWindows as an array of structures for the menusystem,
  7868.              one element for each pull-down menu as follows:
  7869.  
  7870.              typedef struct{
  7871.                 int UpperRow;
  7872.                 int LeftCol;
  7873.                 int LowerRow;
  7874.                 int RightCol;
  7875.                 int Number;
  7876.                 char *WinBuffer;
  7877.                 MSOptions *mso;
  7878.                 }MSWindow;
  7879.  
  7880.  
  7881.  
  7882.  
  7883.  
  7884.                                      Page -129-
  7885.  
  7886.  
  7887.  
  7888.  
  7889.  
  7890.                           SCL1 Version 2.0 Reference Manual
  7891.  
  7892.  
  7893.                                                                  MenuSystem
  7894.  
  7895.           where;
  7896.  
  7897.                  UpperRow - upper row coordinate of the box used to enclose
  7898.                             the pulldown menu (integer).
  7899.  
  7900.                   LeftCol - left column coordinate of the box (integer).
  7901.  
  7902.                  LowerRow - lower row coordinate of the box (integer).
  7903.  
  7904.                  RightCol - right column coordinate of the box (integer).
  7905.  
  7906.                    Number - number of options of the pull-down menu
  7907.                             (integer).
  7908.  
  7909.                 WinBuffer - buffer to store the screen area used when
  7910.                             popping out the pull-down menu.
  7911.  
  7912.                 MSOptions - pointer to the MSOptions structure
  7913.                             corresponding to that pull-down menu.
  7914.  
  7915.           4. The remaining information is defined in a structure type
  7916.              MSData as follows:
  7917.  
  7918.              typedef struct{
  7919.                 int BarNColor;
  7920.                 int BarRColor;
  7921.                 int MenuNColor;
  7922.                 int MenuRColor;
  7923.                 int MenuHColor;
  7924.                 MSBar *msb;
  7925.                 MSWindow *msw;
  7926.                 int Number;
  7927.                 int Menu;
  7928.                 int Option;
  7929.                 unsigned int EventInfo;
  7930.                 }MSData;
  7931.  
  7932.           where;
  7933.  
  7934.              BarNColor - normal color attributes for top row or bar menu
  7935.                          (integer).
  7936.  
  7937.              BarRColor - reversed color attributes for top row or bar menu
  7938.                          (integer).
  7939.  
  7940.  
  7941.  
  7942.  
  7943.                                      Page -130-
  7944.  
  7945.  
  7946.  
  7947.  
  7948.  
  7949.                           SCL1 Version 2.0 Reference Manual
  7950.  
  7951.  
  7952.                                                                  MenuSystem
  7953.  
  7954.             MenuNColor - normal color attributes for the pull-down menus
  7955.                          (integer).
  7956.  
  7957.             MenuRColor - Reversed color attributes for the pull-down menus
  7958.                          (integer).
  7959.  
  7960.             MenuHColor - highlight color attributes for hot-keys in pull
  7961.                          down menus (integer).
  7962.  
  7963.                   MBar - pointer to the corresponding MSBar structure.
  7964.  
  7965.               MSWindow - pointer to the corresponding MSWindow structure.
  7966.  
  7967.                 Number - number of pull-down menus in the system (integer).
  7968.  
  7969.                   Menu - structure member holding the active pull-down menu
  7970.                          number (integer).
  7971.  
  7972.                 Option - structure member holding the active option of the
  7973.                          selected pull-down menu (integer).
  7974.  
  7975.              EventInfo - structure member holding the event information for
  7976.                          the menusystem. (unsigned integer).
  7977.  
  7978.            MenuSysData - pointer to the MenuSysData structure.
  7979.  
  7980.           Messages:
  7981.  
  7982.           The following messages can be sent to Menusystem:
  7983.  
  7984.                         MS_INIT - initialize the MSData structure to NULL
  7985.                                   and set the following values as follows:
  7986.  
  7987.                                  BarNColor - set to black characters in a
  7988.                                              white background or the
  7989.                                              reversed color defined by
  7990.                                              calling SetDialogColors.
  7991.  
  7992.                                  BarRColor - set to white characters in a
  7993.                                              black background or the normal
  7994.                                              color defined by calling
  7995.                                              SetDialogColors.
  7996.  
  7997.                                 MenuNColor - set to white characters in a
  7998.                                              black background or the normal
  7999.                                              color defined by calling
  8000.                                              SetDialogColors.
  8001.  
  8002.                                      Page -131-
  8003.  
  8004.  
  8005.  
  8006.  
  8007.  
  8008.                           SCL1 Version 2.0 Reference Manual
  8009.  
  8010.  
  8011.                                                                  MenuSystem
  8012.  
  8013.                                 MenuRColor - set to black characters in a
  8014.                                              white background or the
  8015.                                              reversed color defined by
  8016.                                              calling SetDialogColors.
  8017.  
  8018.                                 MenuHColor - set to highlighted white
  8019.                                              characters in a black
  8020.                                              background or the normal color
  8021.                                              defined by calling
  8022.                                              SetDialogColors.
  8023.  
  8024.                         MS_DRAW - draw the bar menu.
  8025.  
  8026.                        MS_CHECK - checks if any key or mouse event related
  8027.                                   to the MenuSystem has been activated in
  8028.                                   which case it will retain control and
  8029.                                   respond to the following keys:
  8030.  
  8031.                          Key                      action
  8032.  
  8033.                        Up Arrow         cursor to previous option.
  8034.                        Down Arrow       cursor to next option.
  8035.                        Left Arrow       select previous pull-down menu.
  8036.                        Right Arrow      select next pull-down menu.
  8037.  
  8038.                          MS_KEY - the parameter passed with this message
  8039.                                   (Scan+Ascii code of the key) is a control
  8040.                                   key value that performs as if the control
  8041.                                   key has been pressed.
  8042.  
  8043.                    MS_SHADOW_ON - turn on a shadow effect for pull-down
  8044.                                   menus.  Make sure to set enough space for
  8045.                                   the shadow characters in the MSWindows
  8046.                                   structure.
  8047.  
  8048.                   MS_SHADOW_OFF - turn off shadow effect on pull-down
  8049.                                   menus.
  8050.  
  8051.                      MS_LINE_ON - draw horizontal lines on empty spaces
  8052.                                   inside a menu box.
  8053.  
  8054.                     MS_LINE_OFF - do not draw horizontal lines on empty
  8055.                                   spaces in menu box (default).
  8056.  
  8057.               MS_SET_FRAME_TYPE - sets the frame type for pull down menus
  8058.                                   to the type specified with an additional
  8059.                                   parameter (default is single line).
  8060.  
  8061.                                      Page -132-
  8062.  
  8063.  
  8064.  
  8065.  
  8066.  
  8067.                           SCL1 Version 2.0 Reference Manual
  8068.  
  8069.  
  8070.                                                                  MenuSystem
  8071.  
  8072.                  MS_SET_BAR_ROW - sets the row position where to display
  8073.                                   the bar menu to the value specified with
  8074.                                   an additional parameter (default is "0").
  8075.  
  8076.                MS_SET_BAR_START - sets the column position where the bar
  8077.                                   menu starts to the value specified with
  8078.                                   an additional parameter (default is "0").
  8079.  
  8080.                  MS_SET_BAR_END - sets the column position where the bar
  8081.                                   menu ends to the value specified with an
  8082.                                   additional parameter (default is the
  8083.                                   maximum screen width).
  8084.  
  8085.                       MS_ALT_ON - set ALT key to bring down pull-down
  8086.                                   menus.
  8087.  
  8088.                      MS_ALT_OFF - disable the ALT key to bring pull-down
  8089.                                   menus.
  8090.  
  8091.              MS_SET_FRAME_COLOR - set the pull-down menu box' frame color,
  8092.                                   if this message is not sent it is set to
  8093.                                   normal color.
  8094.  
  8095.            MS_RESET_FRAME_COLOR - reset the pull-down menu box's frame to
  8096.                                   normal color.
  8097.  
  8098.           The following messages can be returned by Menusystem:
  8099.  
  8100.                    MS_NO_SELECT - no selection has been made.
  8101.  
  8102.                           MS_OK - action requested has been successfully
  8103.                                   performed.
  8104.  
  8105.                       MS_SELECT - a selection has been made. This means
  8106.                                   that the structure element containing the
  8107.                                   selection information must be checked to
  8108.                                   determine what has been the selection.
  8109.  
  8110.                       MS_CANCEL - the mouse has been clicked after pointing
  8111.                                   outside the window area or the "ESC" key
  8112.                                   has been pressed.
  8113.  
  8114.  
  8115.  
  8116.  
  8117.  
  8118.  
  8119.  
  8120.                                      Page -133-
  8121.  
  8122.  
  8123.  
  8124.  
  8125.  
  8126.                           SCL1 Version 2.0 Reference Manual
  8127.  
  8128.  
  8129.                                                                  MenuSystem
  8130.  
  8131.           Example:
  8132.  
  8133.  
  8134.           #include <scl1.h>
  8135.           #include <scl1keys.h>
  8136.           #include <scl1clor.h>
  8137.  
  8138.           MSBar msb[]={
  8139.  
  8140.           /* Menu-bar data:
  8141.              Start and end column of each option
  8142.              Menu's key SCAN-ASCII code
  8143.              String */
  8144.  
  8145.              1,6,0x2100," File ",
  8146.              7,12,0x1200," Edit ",
  8147.              };
  8148.  
  8149.           /* first pull-down menu
  8150.              row, column position
  8151.              string
  8152.              hot-key */
  8153.  
  8154.           MSOptions mso0[]={
  8155.              2,1," Load ",'L',
  8156.              3,1," Save ",'S',
  8157.              4,1," Quit ",'Q',
  8158.              };
  8159.  
  8160.           /* second pull-down menu */
  8161.  
  8162.           MSOptions mso1[]={
  8163.              2,7," Mark  ",'M',
  8164.              3,7," Cut   ",'C',
  8165.              4,7," Copy  ",'y',
  8166.              5,7," Paste ",'P',
  8167.              };
  8168.  
  8169.           /* buffer for storing pull down menu screen area */
  8170.  
  8171.           char WindowBuf[140];
  8172.  
  8173.  
  8174.  
  8175.  
  8176.  
  8177.  
  8178.  
  8179.                                      Page -134-
  8180.  
  8181.  
  8182.  
  8183.  
  8184.  
  8185.                           SCL1 Version 2.0 Reference Manual
  8186.  
  8187.  
  8188.                                                                  MenuSystem
  8189.  
  8190.           /* Pull-down menu box & window information
  8191.  
  8192.              top left corner and bottom right corner coordinates
  8193.              number of options
  8194.              buffer for saving screen area
  8195.              MSOptions structure  */
  8196.  
  8197.           MSWindow msw[]={
  8198.              1,0,5,7,3,WindowBuf,mso0,
  8199.              1,6,6,14,4,WindowBuf,mso1,
  8200.              };
  8201.  
  8202.           /* This structure links all previous structures */
  8203.  
  8204.           MSData msd=
  8205.              {
  8206.  
  8207.              /* bar-menu colors */
  8208.              BLACK_WHITE,WHITE_BLACK+HIGHLIGHT,
  8209.  
  8210.              /* pull-down menu colors */
  8211.              WHITE_BLACK,BLACK_WHITE,WHITE_BLACK+HIGHLIGHT,
  8212.  
  8213.              /* MSBar, MSWindow structures, number of menus and internal
  8214.                 variables */
  8215.  
  8216.              msb,msw,2,0,0,0};
  8217.  
  8218.           main()
  8219.              {
  8220.              int Mess;
  8221.  
  8222.              InitMouse(IM_SHOW); /* initialize mouse */
  8223.  
  8224.              /* Draw shadows */
  8225.              MenuSystem(MS_SHADOW_ON,(MSData *)0);
  8226.  
  8227.              /* MenuSystem will be ALT sensitive */
  8228.              MenuSystem(MS_ALT_ON,(MSData *)0);
  8229.  
  8230.              /* draw */
  8231.              MenuSystem(MS_DRAW,&msd);
  8232.  
  8233.  
  8234.  
  8235.  
  8236.  
  8237.  
  8238.                                      Page -135-
  8239.  
  8240.  
  8241.  
  8242.  
  8243.  
  8244.                           SCL1 Version 2.0 Reference Manual
  8245.  
  8246.  
  8247.                                                                  MenuSystem
  8248.  
  8249.              do
  8250.                 {
  8251.                 /* a key pressed? */
  8252.  
  8253.                 if(Mess=KeyReady())
  8254.                    {
  8255.  
  8256.                    /* send key to MenuSystem */
  8257.                    Mess=MenuSystem(MS_KEY,&msd,Mess);
  8258.  
  8259.                    /* If we still have a key it means it was not a
  8260.                       MenuSystem key, discard key. If your program needs to
  8261.                       service the keyboard you should do it here. */
  8262.  
  8263.                    if(KeyReady())
  8264.                        GetKey();
  8265.                    }
  8266.                 else
  8267.  
  8268.                    /* Let MenuSystem check if the mouse has been clicked
  8269.                       or a selection has been made */
  8270.                    Mess=MenuSystem(MS_CHECK,&msd);
  8271.  
  8272.                    if(Mess==MS_SELECT)
  8273.                        {
  8274.  
  8275.                        /* a selection was made, msd.Menu=selected menu */
  8276.  
  8277.                        switch(msd.Menu)
  8278.                          {
  8279.                          case 1:
  8280.  
  8281.                          /* first menu, msd.Option=selected option */
  8282.  
  8283.                             switch(msd.Option)
  8284.                                {
  8285.                                case 1:
  8286.                                   /* first option */
  8287.                                   MessageOn(BLACK_WHITE,"Load");
  8288.                                   WaitTime(100);
  8289.                                   MessageOff();break;
  8290.                                case 2:
  8291.                                   /* second option */
  8292.                                   MessageOn(BLACK_WHITE,"Save");
  8293.                                   WaitTime(100);
  8294.                                   MessageOff();break;
  8295.  
  8296.  
  8297.                                      Page -136-
  8298.  
  8299.  
  8300.  
  8301.  
  8302.  
  8303.                           SCL1 Version 2.0 Reference Manual
  8304.  
  8305.  
  8306.                                                                  MenuSystem
  8307.  
  8308.                                case 3:
  8309.                                   /* third option */
  8310.                                   MessageOn(BLACK_WHITE,"Quit");
  8311.                                   WaitTime(100);
  8312.                                   MessageOff();
  8313.                                   break;
  8314.                                   }
  8315.                          break;
  8316.  
  8317.                        case 2:
  8318.  
  8319.                             /* second menu */
  8320.                             switch(msd.Option)
  8321.                                {
  8322.                                case 1:
  8323.                                   /* first option */
  8324.                                   MessageOn(BLACK_WHITE,"Mark");
  8325.                                   WaitTime(100);
  8326.                                   MessageOff();
  8327.                                   break;
  8328.                                case 2:
  8329.                                   /* second option */
  8330.                                   MessageOn(BLACK_WHITE,"Cut");
  8331.                                   WaitTime(100);
  8332.                                   MessageOff();
  8333.                                   break;
  8334.                                case 3:
  8335.                                   /* third option */
  8336.                                   MessageOn(BLACK_WHITE,"Copy");
  8337.                                   WaitTime(100);
  8338.                                   MessageOff();
  8339.                                   break;
  8340.                                case 4:
  8341.                                   /* fourth option */
  8342.                                   MessageOn(BLACK_WHITE,"Paste");
  8343.                                   WaitTime(100);
  8344.                                   MessageOff();
  8345.                                   break;
  8346.                                }
  8347.                             break;
  8348.                          }
  8349.                    }
  8350.                 }while(msd.Menu != 1 || msd.Option != 3);
  8351.              }
  8352.  
  8353.  
  8354.  
  8355.  
  8356.                                      Page -137-
  8357.  
  8358.  
  8359.  
  8360.  
  8361.  
  8362.                           SCL1 Version 2.0 Reference Manual
  8363.  
  8364.  
  8365.                                                                  MessageOff
  8366.  
  8367.           Function:    MessageOff
  8368.  
  8369.           Purpose:     Removes the message box displayed by MessageOn and
  8370.                        restores the screen's previous contents.
  8371.  
  8372.           Declaration: void MessageOff(void);
  8373.  
  8374.           Returns:     Nothing
  8375.  
  8376.           Parameters:  None
  8377.  
  8378.           Example:
  8379.  
  8380.           #include <scl1.h>
  8381.           #include <scl1clor.h>
  8382.  
  8383.           main()
  8384.              {
  8385.              int i;
  8386.              char buffer[8];
  8387.              memset(buffer,0,sizeof(buffer));
  8388.  
  8389.              /* display message */
  8390.              MessageOn(WHITE_BLACK,"Counting to 30,000...");
  8391.  
  8392.              /* loop */
  8393.              for(i=0;i < 30000; i++)
  8394.  
  8395.                 /* write inside MessageOn screen area */
  8396.                 WriteScreen(WHITE_BLACK,11,38,Bin2Ascii((long)i,buffer));
  8397.  
  8398.              /* restore screen */
  8399.              MessageOff();
  8400.           }
  8401.  
  8402.           See also MessageOn, MessageShadowOff and MessageShadowOn.
  8403.  
  8404.  
  8405.  
  8406.  
  8407.  
  8408.  
  8409.  
  8410.  
  8411.  
  8412.  
  8413.  
  8414.  
  8415.                                      Page -138-
  8416.  
  8417.  
  8418.  
  8419.  
  8420.  
  8421.                           SCL1 Version 2.0 Reference Manual
  8422.  
  8423.  
  8424.                                                                   MessageOn
  8425.  
  8426.           Function:    MessageOn
  8427.  
  8428.           Purpose:     Displays a message inside a box in the center of the
  8429.                        screen.  The screen area is saved and is restored
  8430.                        when MessageOff is called.
  8431.  
  8432.           Declaration: void MessageOn(int Color, char *String);
  8433.  
  8434.           Returns:     Nothing
  8435.  
  8436.           Parameters:
  8437.  
  8438.                  Color - Box/message color (integer).
  8439.  
  8440.                 String - pointer to string.
  8441.  
  8442.           Note:    Messages are written inside a box.  They can have up to
  8443.                    5 lines with up to 40 characters each.  Use control
  8444.                    character '\n' to indicate new line.  The box will stay
  8445.                    on the screen until MessageOff is called.  Each line
  8446.                    will be centered in the window.  Lines will also be
  8447.                    centered vertically.
  8448.  
  8449.           Example:
  8450.  
  8451.           #include <scl1.h>
  8452.           #include <scl1clor.h>
  8453.  
  8454.           main()
  8455.              {
  8456.              int i;
  8457.              char buffer[8];
  8458.              memset(buffer,0,sizeof(buffer));
  8459.  
  8460.              /* display message */
  8461.              MessageOn(WHITE_BLACK,"Counting to 30,000...");
  8462.  
  8463.              /* loop */
  8464.              for(i=0;i < 30000; i++)
  8465.  
  8466.                 /* write inside MessageOn screen area */
  8467.                 WriteScreen(WHITE_BLACK,11,38,Bin2Ascii((long)i,buffer));
  8468.  
  8469.              /* restore screen */
  8470.              MessageOff();
  8471.           }
  8472.           See also MessageOff, MessageShadowOff and MessageShadowOn.
  8473.  
  8474.                                      Page -139-
  8475.  
  8476.  
  8477.  
  8478.  
  8479.  
  8480.                           SCL1 Version 2.0 Reference Manual
  8481.  
  8482.  
  8483.                                                            MessageShadowOff
  8484.                                                             MessageShadowOn
  8485.  
  8486.           Function:    MessageShadowOff
  8487.                        MessageShadowOn
  8488.  
  8489.           Purpose:     Displays or disable a shadow effect when using the
  8490.                        MessageOn/MessageOff functions.  After any of these
  8491.                        functions are called all subsequent calls to the
  8492.                        MessageOn function will be displayed with (or
  8493.                        without) a shadow effect.
  8494.  
  8495.           Declaration: void MessageShadowOff(void);
  8496.                        void MessageShadowOn(void);
  8497.  
  8498.           Returns:     Nothing.
  8499.  
  8500.           Parameters:  None.
  8501.  
  8502.           Example:
  8503.  
  8504.           #include <scl1.h>
  8505.           #include <scl1clor.h>
  8506.  
  8507.           main()
  8508.              {
  8509.              int i;
  8510.  
  8511.              MessageOn(WHITE_BLACK,"MessageOn function without
  8512.                                     shadow\nPress any key...");
  8513.              GetKey();
  8514.              MessageOff();
  8515.              MessageShadowOn();
  8516.              MessageOn(WHITE_BLACK,"MessageOn function WITH shadow
  8517.                                     \nPress any key...");
  8518.              GetKey();
  8519.              MessageOff();
  8520.              MessageShadowOff();
  8521.              MessageOn(WHITE_BLACK,"MessageOn function again\nwithout
  8522.                                     shadow\nPress any key...");
  8523.              GetKey();
  8524.              MessageOff();
  8525.              }
  8526.  
  8527.           See MessageOn and MessageOff.
  8528.  
  8529.  
  8530.  
  8531.  
  8532.  
  8533.                                      Page -140-
  8534.  
  8535.  
  8536.  
  8537.  
  8538.  
  8539.                           SCL1 Version 2.0 Reference Manual
  8540.  
  8541.  
  8542.                                                                 MouseButton
  8543.  
  8544.           Function:    MouseButton
  8545.  
  8546.           Purpose:     A Mouse Button is a prompt that can be placed
  8547.                        anywhere within the screen area and, when that when
  8548.                        pointed and clicked by the mouse performs a given
  8549.                        action.  It performs as a sensitive screen prompt. 
  8550.                        The selected button is drawn in the specified color
  8551.                        with or without a enclosing box. Most functions,
  8552.                        like FileBox, use Mouse Buttons (in this case to
  8553.                        select load or cancel).  If you require more than
  8554.                        one Mouse Button use the Fields2 function.
  8555.  
  8556.           Declaration: int MouseButton(int Message,MBData *p);
  8557.  
  8558.           Returns:     This is a dialog type function. See Appendix "E" for
  8559.                        a description of the general operation of these
  8560.                        functions.  The return value is a message described
  8561.                        in the Messages section.
  8562.  
  8563.           Parameters:
  8564.  
  8565.           The MouseButton information must be given in a structure, type
  8566.           MBData, as follows:
  8567.  
  8568.           Structure type MBData:
  8569.  
  8570.           typedef struct{
  8571.              int NColor;
  8572.              int RColor;
  8573.              int UpperRow;
  8574.              int LeftCol;
  8575.              int LowerRow;
  8576.              int RightCol;
  8577.              int PRow;
  8578.              int PCol;
  8579.              char *Prompt;
  8580.              int BoxFlag;
  8581.              int ActiveFlag;
  8582.              unsigned int *ExitKeys;
  8583.              unsigned int EventInfo;
  8584.              }MBData;
  8585.  
  8586.           where,
  8587.  
  8588.                 NColor - color attribute used when button is not selected
  8589.                          (integer).
  8590.  
  8591.  
  8592.                                      Page -141-
  8593.  
  8594.  
  8595.  
  8596.  
  8597.  
  8598.                           SCL1 Version 2.0 Reference Manual
  8599.  
  8600.  
  8601.                                                                 MouseButton
  8602.  
  8603.                 RColor - Color used for a selected button (integer).
  8604.  
  8605.               UpperRow - upper row coordinate of the Mouse Button area
  8606.                          (integer).
  8607.  
  8608.                LeftCol - left column coordinate of the Mouse Button area
  8609.                          (integer).
  8610.  
  8611.               LowerRow - lower row coordinate of the Mouse Button area
  8612.                          (integer).
  8613.  
  8614.               RightCol - right column coordinate of the Mouse Button area
  8615.                          (integer).
  8616.  
  8617.                   PRow - row coordinate of the Mouse Button text (integer).
  8618.  
  8619.                   PCol - column coordinate of the Mouse Button text
  8620.                          (integer).
  8621.  
  8622.                 Prompt - char pointer to the Mouse Button text.
  8623.  
  8624.                BoxFlag - a flag to indicate if a box shall be drawn around
  8625.                          a Mouse Button (integer).
  8626.  
  8627.             ActiveFlag - a flag to indicate if the Mouse Button is active
  8628.                          (integer).
  8629.  
  8630.               ExitKeys - an array of keys defined to exit the function
  8631.                          (unsigned integer).
  8632.  
  8633.              EventInfo - variable that holds the key pressed when you exit
  8634.                          the function or a non defined key is pressed
  8635.                          (unsigned integer).
  8636.           Messages:
  8637.  
  8638.           The following messages can be sent to MouseButton:
  8639.  
  8640.                         MB_INIT - initialize the MBData structure to NULL
  8641.                                   and  set the following default values:
  8642.  
  8643.                                     NColor - set to white characters in a
  8644.                                              black background or the normal
  8645.                                              color defined by calling
  8646.                                              SetDialogColors.
  8647.  
  8648.  
  8649.  
  8650.  
  8651.                                      Page -142-
  8652.  
  8653.  
  8654.  
  8655.  
  8656.  
  8657.                           SCL1 Version 2.0 Reference Manual
  8658.  
  8659.  
  8660.                                                                 MouseButton
  8661.  
  8662.                                     RColor - set to black characters in a
  8663.                                              white background or the
  8664.                                              reversed color defined by
  8665.                                              calling SetDialogColors.
  8666.  
  8667.                         MB_DRAW - display the Mouse Button.
  8668.  
  8669.                       MB_ACTIVE - move the cursor to the Mouse Button. 
  8670.                                   This message is used by the Fields2
  8671.                                   function.
  8672.  
  8673.                  MB_CHECK_MOUSE - check to see if the mouse has been
  8674.                                   clicked after pointing to the Mouse
  8675.                                   Button.
  8676.  
  8677.                        MB_RESET - when this message is sent Mouse Button
  8678.                                   variables are reset to the default value. 
  8679.                                   If the exit keys have not been defined
  8680.                                   they are set to the default exit keys.
  8681.  
  8682.           The following messages can be returned by MouseButton:
  8683.  
  8684.                           MB_OK - the function has performed the requested
  8685.                                   action.
  8686.  
  8687.                     MB_EXIT_KEY - a key that has been defined as an exit
  8688.                                   key has been pressed.
  8689.  
  8690.                  MB_MOUSE_EVENT - the mouse has been clicked after pointing
  8691.                                   outside the area defined by the function.
  8692.  
  8693.                  MB_ILLEGAL_KEY - a key that has not been defined has been
  8694.                                   pressed.
  8695.  
  8696.                 MB_MOUSE_SELECT - you have clicked your mouse after
  8697.                                   pointing to the Mouse Button.
  8698.  
  8699.                     MB_MY_MOUSE - response to a MB_CHECK_MOUSE message if
  8700.                                   the mouse has been clicked after pointing
  8701.                                   to the area defined by the function.
  8702.  
  8703.  
  8704.  
  8705.  
  8706.  
  8707.  
  8708.  
  8709.  
  8710.                                      Page -143-
  8711.  
  8712.  
  8713.  
  8714.  
  8715.  
  8716.                           SCL1 Version 2.0 Reference Manual
  8717.  
  8718.  
  8719.                                                                 MouseButton
  8720.  
  8721.           Example:
  8722.  
  8723.           #include <scl1.h>
  8724.           #include <scl1keys.h>
  8725.  
  8726.           main()
  8727.              {
  8728.              int EMess;
  8729.              MBData mb1;
  8730.  
  8731.              Cls(WHITE_BLACK,CLS_ALL);
  8732.              MouseButton(MB_INIT,&mb1);
  8733.              mb1.LeftCol=12;
  8734.              mb1.RightCol=19;
  8735.              mb1.NColor=Color1;
  8736.              mb1.RColor=Color2;
  8737.              mb1.UpperRow=6;
  8738.              mb1.Prompt="< LOAD >";;
  8739.              MouseButton(MB_DRAW,&mb1);
  8740.              do
  8741.                 {
  8742.                 EMess=MouseButton(MB_ACTIVE,&mb1);
  8743.                 }while(EMess != MB_EXIT_KEY && EMess != MB_MOUSE_SELECT);
  8744.              }
  8745.  
  8746.  
  8747.  
  8748.  
  8749.  
  8750.  
  8751.  
  8752.  
  8753.  
  8754.  
  8755.  
  8756.  
  8757.  
  8758.  
  8759.  
  8760.  
  8761.  
  8762.  
  8763.  
  8764.  
  8765.  
  8766.  
  8767.  
  8768.  
  8769.                                      Page -144-
  8770.  
  8771.  
  8772.  
  8773.  
  8774.  
  8775.                           SCL1 Version 2.0 Reference Manual
  8776.  
  8777.  
  8778.                                                                   MouseMenu
  8779.  
  8780.           Function:    MouseMenu
  8781.  
  8782.           Purpose:     Displays a scrolling or moving bar type menu.  A
  8783.                        selection is made by either pressing the highlighted
  8784.                        menu option letter, by scrolling the highlighted bar
  8785.                        using the arrow keys and then pressing the ENTER
  8786.                        (RETURN) key or by moving the mouse cursor to the
  8787.                        desired line and clicking the left mouse button. 
  8788.                        This function permits full control of the menu's
  8789.                        appearance, size and position.  The menu items can
  8790.                        be placed anywhere in the screen and in any desired
  8791.                        order, you are not limited to placing all the menu
  8792.                        options in successive lines.
  8793.  
  8794.           Declaration: int MouseMenu(int NColor, int RColor, int HColor,
  8795.                            int NumOpt, struct MenuOpt *k, int XMin,
  8796.                            int XMax, int YMin, int YMax);
  8797.  
  8798.           Returns:     The highlighted selection number (>1) or -1 if ESC
  8799.                        is pressed or if mouse is clicked outside the menu
  8800.                        area.
  8801.  
  8802.           Parameters:
  8803.  
  8804.           The menu information must be entered as an array of structures as
  8805.           follows; with one array element for each menu option:
  8806.  
  8807.              struct MenuOpt{
  8808.                 int Row,Col;
  8809.                 char *String;
  8810.                 char Letter;
  8811.                 };
  8812.  
  8813.           where:
  8814.  
  8815.                    Row - row position for the menu item (integer).
  8816.  
  8817.                    Col - column position for the menu item (integer).
  8818.  
  8819.                 String - pointer to the menu item text.
  8820.  
  8821.                 Letter - letter to be highlighted for fast keyboard
  8822.                          selection of the menu item (char).
  8823.  
  8824.  
  8825.  
  8826.  
  8827.  
  8828.                                      Page -145-
  8829.  
  8830.  
  8831.  
  8832.  
  8833.  
  8834.                           SCL1 Version 2.0 Reference Manual
  8835.  
  8836.  
  8837.                                                                   MouseMenu
  8838.  
  8839.           The parameters passed to the function are:
  8840.  
  8841.                 NColor - color attribute for the menu background and
  8842.                          foreground (integer).
  8843.  
  8844.                 RColor - color attribute for the highlighted item menu bar
  8845.                          (integer).
  8846.  
  8847.                 HColor - color attribute for the highlighted quick
  8848.                          selection menu item letter (integer).
  8849.  
  8850.                 NumOpt - number of menu options (integer).
  8851.  
  8852.                MenuOpt - pointer to the menu structure previously defined.
  8853.  
  8854.                   XMin - minimum row position of menu area (integer).
  8855.  
  8856.                   XMax - maximum row position of menu area (integer).
  8857.  
  8858.                   YMin - minimum column position of menu area (integer).
  8859.  
  8860.                   YMax - maximum column position of menu area (integer).
  8861.  
  8862.           Example:
  8863.  
  8864.           #include <scl1.h>
  8865.           #include <scl1clor.h>
  8866.  
  8867.           struct MenuOpt Mainmen[7]={/*Array of structures with seven
  8868.                                        elements */
  8869.               5,24,"Screen Related Functions    ",'S', /* First option   */
  8870.               7,24,"Keyboard Handling Functions ",'K', /* Second option  */
  8871.               9,24,"Mouse Handling Functions    ",'M', /* Third option   */
  8872.              11,24,"Program Flow Functions      ",'P', /* Fourth option  */
  8873.              13,24,"File Handling Functions     ",'F', /* Fifth option   */
  8874.              15,24,"Background and Miscellaneous",'B', /* Sixth option   */
  8875.              17,24,"Exit Demo                   ",'E', /* Seventh option */
  8876.                 };
  8877.  
  8878.  
  8879.  
  8880.  
  8881.  
  8882.  
  8883.  
  8884.  
  8885.  
  8886.  
  8887.                                      Page -146-
  8888.  
  8889.  
  8890.  
  8891.  
  8892.  
  8893.                           SCL1 Version 2.0 Reference Manual
  8894.  
  8895.  
  8896.                                                                   MouseMenu
  8897.  
  8898.           main()
  8899.              {
  8900.              int Selection;
  8901.  
  8902.              Cls(WHITE_BLACK,CLS_ALL);
  8903.              InitMouse(IM_SHOW);
  8904.              Box(WHITE_BLACK,5,1,5,18,25); /* Box for menu */
  8905.              WriteScreen(WHITE_BLACK,2,11,"FUNCTIONS"); /* Menu title */
  8906.              Selection=MouseMenu(WHITE_BLACK,BLACK_WHITE,
  8907.                 WHITE_BLACK+HIGHLIGHT,7,Mainmen,1,5,18,25);
  8908.              Cls(WHITE_BLACK,CLS_ALL);
  8909.              if(Selection > 0)
  8910.                 printf("You have selected option %i\n",Selection);
  8911.              else
  8912.                 printf("You have pressed ESCAPE or clicked the mouse
  8913.                    outside the menu area.\n");
  8914.              }
  8915.  
  8916.  
  8917.  
  8918.  
  8919.  
  8920.  
  8921.  
  8922.  
  8923.  
  8924.  
  8925.  
  8926.  
  8927.  
  8928.  
  8929.  
  8930.  
  8931.  
  8932.  
  8933.  
  8934.  
  8935.  
  8936.  
  8937.  
  8938.  
  8939.  
  8940.  
  8941.  
  8942.  
  8943.  
  8944.  
  8945.  
  8946.                                      Page -147-
  8947.  
  8948.  
  8949.  
  8950.  
  8951.  
  8952.                           SCL1 Version 2.0 Reference Manual
  8953.  
  8954.  
  8955.                                                                  MoveFilePt
  8956.  
  8957.           Function:    MoveFilePt
  8958.  
  8959.           Purpose:     Moves the file pointer to the current location plus
  8960.                        an offset.
  8961.  
  8962.           Declaration: int MoveFilePt(int Handle, unsigned long Bytes);
  8963.  
  8964.           Returns:     The return value is "0" if no error occurs or the
  8965.                        DOS error code if an error occurs.  (See Appendix
  8966.                        "A", FILE FUNCTIONS, for more information).
  8967.  
  8968.           Parameters:
  8969.  
  8970.                 Handle - number is given by DOS when you open a file
  8971.                          (integer).
  8972.  
  8973.                  Bytes - number of bytes for offset (unsigned long
  8974.                          integer).
  8975.  
  8976.           Example:
  8977.  
  8978.           #include <scl1.h>
  8979.           #include <string.h>
  8980.  
  8981.           /* This example creates a file with several names in lower-case.
  8982.           We will then open the file for appending data using MoveFilePt by
  8983.           moving the file pointer to the end of the file. */
  8984.  
  8985.           struct NAME_REC{     /* Our file format */
  8986.              char Name[7];
  8987.              }nr;              /* nr will be used as a buffer for
  8988.                                converting strings to uppercase */
  8989.           /* This is the data of the file we will create */
  8990.  
  8991.           struct NAME_REC names[]={
  8992.              "John",
  8993.              "Mary",
  8994.              "Robert",
  8995.              "Ann"};
  8996.  
  8997.           struct NAME_REC newname={"Susan"};
  8998.  
  8999.           main()
  9000.              {
  9001.              int handle;
  9002.              long filesize;
  9003.  
  9004.  
  9005.                                      Page -148-
  9006.  
  9007.  
  9008.  
  9009.  
  9010.  
  9011.                           SCL1 Version 2.0 Reference Manual
  9012.  
  9013.  
  9014.                                                                  MoveFilePt
  9015.  
  9016.              /* create file */
  9017.  
  9018.              if(Buf2Disk("DEMO.FL",(char *)names,sizeof(names)))
  9019.                 {
  9020.                 printf("Error creating file\n");
  9021.                 exit(-1);
  9022.                 }
  9023.  
  9024.              /* Open file for reading and writing */
  9025.  
  9026.              OpenFile("DEMO.FL",&handle,DOS2_RW);
  9027.  
  9028.              /* Get file size */
  9029.  
  9030.              filesize=GetFileSize(handle);
  9031.  
  9032.              /* move file pointer to end of file */
  9033.  
  9034.              MoveFilePt(handle,filesize);
  9035.  
  9036.              /* write our data */
  9037.  
  9038.              WriteFile(handle,(char *)&newname,sizeof(struct NAME_REC));
  9039.              }
  9040.           CloseFile(handle);
  9041.           }
  9042.  
  9043.           See also MoveFilePtOffset.
  9044.  
  9045.  
  9046.  
  9047.  
  9048.  
  9049.  
  9050.  
  9051.  
  9052.  
  9053.  
  9054.  
  9055.  
  9056.  
  9057.  
  9058.  
  9059.  
  9060.  
  9061.  
  9062.  
  9063.  
  9064.                                      Page -149-
  9065.  
  9066.  
  9067.  
  9068.  
  9069.  
  9070.                           SCL1 Version 2.0 Reference Manual
  9071.  
  9072.  
  9073.                                                           MoveFilePt2Offset
  9074.  
  9075.           Function:    MoveFilePt2Offset
  9076.  
  9077.           Purpose:     Moves the file read write pointer to an offset from
  9078.                        the beginning of the file.
  9079.  
  9080.           Declaration: int MoveFilePt2Offset(int Handle,
  9081.                             unsigned long Bytes);
  9082.  
  9083.           Returns:     The return value is 0 if no error occur or the DOS
  9084.                        error code if an error occur.  (See Appendix "A",
  9085.                        FILE FUNCTIONS, for more information).
  9086.  
  9087.           Parameters:
  9088.  
  9089.                 Handle - number is given by DOS when you open a file
  9090.                          (integer).
  9091.  
  9092.                  Bytes - number of bytes for offset (unsigned long
  9093.                          integer).
  9094.  
  9095.           Example:
  9096.  
  9097.           #include <scl1.h>
  9098.           #include <string.h>
  9099.  
  9100.              /* This example creates a file with several names in lower-
  9101.              case.  We will read this file one record at a time into our
  9102.              buffer and convert the string to uppercase before rewriting it
  9103.              back to disk. For simplicity, no error checking is shown in
  9104.              the example */
  9105.  
  9106.           struct NAME_REC{       /* Our file format */
  9107.                char Name[7];
  9108.                }nr;             /* nr will be used as a buffer for
  9109.                                    converting strings to uppercase */
  9110.  
  9111.           /* This is the data of the file we will create */
  9112.  
  9113.           struct NAME_REC names[]={
  9114.              "John",
  9115.              "Mary",
  9116.              "Robert",
  9117.              "Ann"};
  9118.  
  9119.  
  9120.  
  9121.  
  9122.  
  9123.                                      Page -150-
  9124.  
  9125.  
  9126.  
  9127.  
  9128.  
  9129.                           SCL1 Version 2.0 Reference Manual
  9130.  
  9131.  
  9132.                                                           MoveFilePt2Offset
  9133.  
  9134.           main()
  9135.              {
  9136.              int handle,i,j;
  9137.              long fileptr,records;
  9138.  
  9139.               /* create file */
  9140.  
  9141.              if(Buf2Disk("DEMO.FL",(char *)names,sizeof(names)))
  9142.                 {
  9143.                 printf("Error creating file\n");
  9144.                 exit(-1);
  9145.                 }
  9146.  
  9147.              /* Open file for reading and writing */
  9148.  
  9149.              OpenFile("DEMO.FL",&handle,DOS2_RW);
  9150.  
  9151.              /* number of records in file = file size / size of structure
  9152.                 NAME_REC */
  9153.  
  9154.              records=GetFileSize(handle)/sizeof(struct NAME_REC);
  9155.  
  9156.              /* read one record at a time while there are records */
  9157.              for(;records > 0;--records)
  9158.                 {
  9159.  
  9160.                 /* save actual file pointer position */
  9161.                 fileptr=GetFilePt(handle);
  9162.  
  9163.                 /* read data, file pointer is automatically moved to next
  9164.                    record by DOS */
  9165.  
  9166.                 ReadFile(handle,(char *)&nr,sizeof(struct NAME_REC));
  9167.  
  9168.                 /* capitalize name */
  9169.                 strupr(nr.Name);
  9170.  
  9171.                 /* move file pointer to original position */
  9172.                 MoveFilePt2Offset(handle,fileptr);
  9173.  
  9174.                 /* write our data, pointer points again to next record */
  9175.                 WriteFile(handle,(char *)&nr,sizeof(struct NAME_REC));
  9176.                 }
  9177.              CloseFile(handle);
  9178.              system("type DEMO.FL");
  9179.              }
  9180.           See also MoveFilePt.
  9181.  
  9182.                                      Page -151-
  9183.  
  9184.  
  9185.  
  9186.  
  9187.  
  9188.                           SCL1 Version 2.0 Reference Manual
  9189.  
  9190.  
  9191.                                                                    OpenFile
  9192.  
  9193.           Function:    OpenFile
  9194.  
  9195.           Purpose:     Opens and existing file.
  9196.  
  9197.           Declaration: int OpenFile(char *Filename, int *Handle,
  9198.                             char OMode);
  9199.  
  9200.           Returns:     The return value is "0" if no error occurs or the
  9201.                        DOS error code if an error occurs.  (See Appendix
  9202.                        "A", FILE FUNCTIONS, for more information).
  9203.  
  9204.           Parameters:
  9205.  
  9206.               Filename - pointer to filename (char).
  9207.  
  9208.                FHandle - pointer to variable that will hold DOS handle
  9209.                          number (integer).
  9210.  
  9211.                  OMode - One of several Open modes as defined in SCL1.H
  9212.                          (char):
  9213.  
  9214.                        DOS2_READ  -  For reading only.
  9215.                        DOS2_WRITE -  For writing.
  9216.                        DOS2_RW    -  For reading and writing.
  9217.  
  9218.                    Any of these modes can be used with DOS 2.0 or higher.
  9219.  
  9220.                    The following can only be used with DOS 3.0 and higher.
  9221.                    Here the Open Mode parameter is composed of three parts:
  9222.                    the Inheritance Flag, that determines if child processes
  9223.                    will inherit open files; the Sharing Mode, that
  9224.                    determines if file can be shared by several processes;
  9225.                    and the Access Mode that is similar to DOS 2.0 Open
  9226.                    Mode. You must add the three flags to get the desired
  9227.                    open mode.
  9228.  
  9229.                    Inheritance Flag:
  9230.  
  9231.                    DOS3_INHERIT   -  Child process inherit open files.
  9232.                    DOS3_PRIVATE   -  No inheritance.
  9233.  
  9234.  
  9235.  
  9236.  
  9237.  
  9238.  
  9239.  
  9240.  
  9241.                                      Page -152-
  9242.  
  9243.  
  9244.  
  9245.  
  9246.  
  9247.                           SCL1 Version 2.0 Reference Manual
  9248.  
  9249.  
  9250.                                                                    OpenFile
  9251.  
  9252.                    Sharing mode:
  9253.  
  9254.                    DOS3_COMP      -  Compatible with DOS 2.0
  9255.                    DOS3_DENY_RW   -  Deny read or write to other       
  9256.                                      processes.
  9257.                    DOS3_DENY_W    -  Deny write.
  9258.                    DOS3_DENY_R    -  Deny read.
  9259.                    DOS3_DENY_NONE -  Deny none.
  9260.  
  9261.  
  9262.                    Access mode:
  9263.                    DOS3_READ, DOS3_WRITE, DOS3_RW are similar to DOS 2.0.
  9264.  
  9265.                    See DOS 3.0 Technical Reference for more information.
  9266.  
  9267.           Example:
  9268.  
  9269.           #include <scl1.h>
  9270.  
  9271.           main()
  9272.              {
  9273.              int ErrorCode;
  9274.                 if((ErrorCode=OpenFile("FILE.1",&Handle,DOS2_RW)))
  9275.                 /* Open a file for reading & writing */
  9276.                 {
  9277.                 .  /* Error Routine */
  9278.                 .
  9279.                 }
  9280.              }
  9281.  
  9282.  
  9283.  
  9284.  
  9285.  
  9286.  
  9287.  
  9288.  
  9289.  
  9290.  
  9291.  
  9292.  
  9293.  
  9294.  
  9295.  
  9296.  
  9297.  
  9298.  
  9299.  
  9300.                                      Page -153-
  9301.  
  9302.  
  9303.  
  9304.  
  9305.  
  9306.                           SCL1 Version 2.0 Reference Manual
  9307.  
  9308.  
  9309.                                                                  PushCursor
  9310.                                                                   PopCursor
  9311.  
  9312.           Function:    PushCursor
  9313.                        PopCursor
  9314.  
  9315.           Purpose:     Saves (PushCursor) or restores (PopCursor) the
  9316.                        cursor size, shape and position.  The maximum number
  9317.                        of cursors that the function stack can hold is
  9318.                        twenty.
  9319.  
  9320.           Declaration: int PushCursor(void);
  9321.                        int PopCursor(void);
  9322.  
  9323.           Returns:     Nothing.
  9324.  
  9325.           Parameters:  None.
  9326.  
  9327.           Example:
  9328.  
  9329.           #include <scl1.h>
  9330.  
  9331.           main()
  9332.              {
  9333.              PushCursor();
  9334.              .
  9335.              .
  9336.              .
  9337.              PopCursor();
  9338.              }
  9339.  
  9340.  
  9341.  
  9342.  
  9343.  
  9344.  
  9345.  
  9346.  
  9347.  
  9348.  
  9349.  
  9350.  
  9351.  
  9352.  
  9353.  
  9354.  
  9355.  
  9356.  
  9357.  
  9358.  
  9359.                                      Page -154-
  9360.  
  9361.  
  9362.  
  9363.  
  9364.  
  9365.                           SCL1 Version 2.0 Reference Manual
  9366.  
  9367.  
  9368.                                                                     PopMenu
  9369.  
  9370.           Function:    PopMenu
  9371.  
  9372.           Purpose:     Similar to Mouse Menu but draws the menu box and
  9373.                        saves the area behind the menu box.  If the left or
  9374.                        right arrow is pressed the routine exits and returns
  9375.                        a value indicating which arrow key has been pressed.
  9376.  
  9377.           Declaration: int PopMenu(int Color,int RColor, int HColor,
  9378.                            struct PopMenuData *k);
  9379.  
  9380.           Returns:     Return values are:
  9381.  
  9382.                        "-3" if the right cursor key is pressed, "-2" if the
  9383.                        left cursor key is pressed,"-1" if ESCAPE is pressed
  9384.                        or the option number if an option key is pressed.
  9385.  
  9386.           Parameters:
  9387.  
  9388.           The menu information must be given as an array of structures as
  9389.           follows:
  9390.  
  9391.              struct PopMenuData{
  9392.                 int L1,C1,L2,C2;
  9393.                 int NumberOption;
  9394.                 char *WinBuffer;
  9395.                 struct MenuOpt *Menust;
  9396.                 };
  9397.  
  9398.           where;
  9399.  
  9400.                        L1 - upper row coordinate of the box used to enclose
  9401.                             the pull-down menu (integer).
  9402.  
  9403.                        C1 - left column coordinate of the box (integer).
  9404.  
  9405.                        L2 - lower row coordinate of the box (integer).
  9406.  
  9407.                        C2 - right column coordinate of the box (integer).
  9408.  
  9409.             NumberOptions - number of options of the pull-down menu
  9410.                             (integer).
  9411.  
  9412.                 WinBuffer - buffer to store the screen area used when
  9413.                             popping out the pull-down menu.
  9414.  
  9415.                   MenuOpt - pointer to the MenuOption structure
  9416.                             corresponding to that pull-down menu.
  9417.  
  9418.                                      Page -155-
  9419.  
  9420.  
  9421.  
  9422.  
  9423.  
  9424.                           SCL1 Version 2.0 Reference Manual
  9425.  
  9426.  
  9427.                                                                     PopMenu
  9428.  
  9429.           Example:
  9430.  
  9431.           #include <scl1.h>
  9432.           #include <scl1clor.h>
  9433.  
  9434.           struct MenuOpt Men1[]={
  9435.              2,5,"New    ",'N',
  9436.              3,5,"Open   ",'O',
  9437.              4,5,"Close  ",'C',
  9438.              5,5,"Save   ",'S',
  9439.              6,5,"Exit   ",'E',
  9440.              };
  9441.  
  9442.           struct PopMenuData pmd1[]={
  9443.              1,3,7,13,
  9444.              5,
  9445.              WinBuf1,
  9446.              Men1,
  9447.              };
  9448.  
  9449.           int Color1=WHITE_BLACK;
  9450.           int Color2=BLACK_WHITE;
  9451.           int Color3=BLACK_WHITE+HIGHLIGHT;
  9452.  
  9453.           main()
  9454.              {
  9455.              int Selection;
  9456.  
  9457.              Selection=PopMenu(Color1,Color2,Color3,pmd1);
  9458.              }
  9459.  
  9460.  
  9461.  
  9462.  
  9463.  
  9464.  
  9465.  
  9466.  
  9467.  
  9468.  
  9469.  
  9470.  
  9471.  
  9472.  
  9473.  
  9474.  
  9475.  
  9476.  
  9477.                                      Page -156-
  9478.  
  9479.  
  9480.  
  9481.  
  9482.  
  9483.                           SCL1 Version 2.0 Reference Manual
  9484.  
  9485.  
  9486.                                                                    ReadFile
  9487.  
  9488.           Function:    ReadFile
  9489.  
  9490.           Purpose:     Reads number of bytes from a file
  9491.  
  9492.           Declaration: int ReadFile(int Handle,char *Buffer,
  9493.                            unsigned int Bytes);
  9494.  
  9495.           Returns:     The return value is "0" if no error occurs or the
  9496.                        DOS error code if an error occurs.  (See Appendix
  9497.                        "A", FILE FUNCTIONS, for more information).
  9498.  
  9499.           Parameters:
  9500.  
  9501.                 Handle - handle number given by DOS when you open or create
  9502.                          a file (integer).
  9503.  
  9504.                 Buffer - pointer to the buffer that will hold the data.
  9505.  
  9506.                  Bytes - pointer to a variable that holds the number of
  9507.                          bytes to read (unsigned integer).
  9508.  
  9509.           Example:
  9510.  
  9511.           #include <scl1.h>
  9512.           #define FILE_TOO_BIG 255
  9513.  
  9514.           int File2Buf(char *FileName,char *Buffer,unsigned int * MaxSize)
  9515.           {
  9516.           int i,Handle;
  9517.           unsigned int Size;
  9518.  
  9519.           if(i=OpenFile(Filename,&Handle,DOS2_READ))
  9520.              return(i);
  9521.           if((Size=GetFileSize(Handle)> *MaxSize)
  9522.              {
  9523.              CloseFile(Handle);
  9524.              return(FILE_TOO_BIG);
  9525.              }
  9526.           if(i=ReadFile(Handle,Buffer,Size))
  9527.              {
  9528.              If(i>0)
  9529.                 CloseFile(Handle);
  9530.              return(i);
  9531.              }
  9532.           *MaxSize=Size;
  9533.           return(CloseFile(Handle));
  9534.           }
  9535.  
  9536.                                      Page -157-
  9537.  
  9538.  
  9539.  
  9540.  
  9541.  
  9542.                           SCL1 Version 2.0 Reference Manual
  9543.  
  9544.  
  9545.                                                                   RemoveDir
  9546.  
  9547.           Function:    RemoveDir
  9548.  
  9549.           Purpose:     Removes a directory
  9550.  
  9551.           Declaration: int RemoveDir(char *Path);
  9552.  
  9553.           Returns:     The return value is "0" if no error occurs or the
  9554.                        DOS error code if an error occurs.  (See Appendix
  9555.                        "A", FILE FUNCTIONS, for more information).
  9556.  
  9557.           Parameters:
  9558.  
  9559.                   Path - char pointer to directory string.
  9560.  
  9561.           Example:
  9562.  
  9563.           #include <scl1.h>
  9564.  
  9565.           main()
  9566.              {
  9567.              int ErrorCode;
  9568.  
  9569.              if((ErrorCode=RemoveDir("C:\\LETTERS")))
  9570.                 {
  9571.                 .  /* Error Routine */
  9572.                 .
  9573.                 }
  9574.              }
  9575.  
  9576.  
  9577.  
  9578.  
  9579.  
  9580.  
  9581.  
  9582.  
  9583.  
  9584.  
  9585.  
  9586.  
  9587.  
  9588.  
  9589.  
  9590.  
  9591.  
  9592.  
  9593.  
  9594.  
  9595.                                      Page -158-
  9596.  
  9597.  
  9598.  
  9599.  
  9600.  
  9601.                           SCL1 Version 2.0 Reference Manual
  9602.  
  9603.  
  9604.                                                             RemoveExtension
  9605.  
  9606.           Function:    RemoveExtension
  9607.  
  9608.           Purpose:     Removes or deletes the extension of a filename.
  9609.  
  9610.           Declaration: char *RemoveExtension(char *Filename);
  9611.  
  9612.           Returns:     The return value is a pointer to the filename
  9613.                        buffer.
  9614.  
  9615.           Parameters:
  9616.  
  9617.               Filename - char pointer to filename.
  9618.  
  9619.           Example:
  9620.  
  9621.           #include <scl1.h>
  9622.  
  9623.           char Filename[13]="FILE.C";
  9624.  
  9625.           main()
  9626.              {
  9627.              printf("%s\n",Filename);
  9628.              printf("%s\n",RemoveExtension(Filename));
  9629.              }
  9630.  
  9631.           See also ChangeExtension and AddExtension
  9632.  
  9633.  
  9634.  
  9635.  
  9636.  
  9637.  
  9638.  
  9639.  
  9640.  
  9641.  
  9642.  
  9643.  
  9644.  
  9645.  
  9646.  
  9647.  
  9648.  
  9649.  
  9650.  
  9651.  
  9652.  
  9653.  
  9654.                                      Page -159-
  9655.  
  9656.  
  9657.  
  9658.  
  9659.  
  9660.                           SCL1 Version 2.0 Reference Manual
  9661.  
  9662.  
  9663.                                                                  RenameFile
  9664.  
  9665.           Function:    RenameFile
  9666.  
  9667.           Purpose:     Renames or moves a file.
  9668.  
  9669.           Declaration: int RenameFile(char *OldName,char *NewName);
  9670.  
  9671.           Returns:     The return value is "0" if no error occurs or the
  9672.                        DOS error code if an error occurs.  (See Appendix
  9673.                        "A", FILE FUNCTIONS, for more information).
  9674.  
  9675.           Parameters:
  9676.  
  9677.                 OldName - pointer to the old filename (char).
  9678.  
  9679.                 NewName - pointer to the new filename (char).
  9680.  
  9681.           Example:
  9682.  
  9683.           #include <scl1.h>
  9684.  
  9685.           main()
  9686.              {
  9687.              int ErrorCode;
  9688.  
  9689.              if((ErrorCode=RenameFile("C:\\FILE.1","C:\\FILE.BAK")))
  9690.                 {
  9691.                 .  /* Error Routine */
  9692.                 .
  9693.                 }
  9694.              }
  9695.  
  9696.  
  9697.  
  9698.  
  9699.  
  9700.  
  9701.  
  9702.  
  9703.  
  9704.  
  9705.  
  9706.  
  9707.  
  9708.  
  9709.  
  9710.  
  9711.  
  9712.  
  9713.                                      Page -160-
  9714.  
  9715.  
  9716.  
  9717.  
  9718.  
  9719.                           SCL1 Version 2.0 Reference Manual
  9720.  
  9721.  
  9722.                                                                  ResetMouse
  9723.  
  9724.           Function:    ResetMouse
  9725.  
  9726.           Purpose:     Resets mouse to default condition (cursor hidden at
  9727.                        screen center and Interrupt service routine
  9728.                        disabled).
  9729.  
  9730.           Declaration: void ResetMouse(void);
  9731.  
  9732.           Returns:     Nothing.
  9733.  
  9734.           Parameters:  None
  9735.  
  9736.           Example:
  9737.  
  9738.           #include <scl1.h>
  9739.  
  9740.           main()
  9741.              {
  9742.  
  9743.              /* do we have a mouse? */
  9744.              if(CheckMouse())
  9745.                 {
  9746.                 /* Yes */
  9747.                 ResetMouse();  /* reset mouse */
  9748.                 SetMouseIsr(); /* initialize ISR */
  9749.                 ShowMouse();   /* cursor on */
  9750.                 }
  9751.              .
  9752.              .
  9753.              .
  9754.              ResetMouse();  /* reset mouse before exit */
  9755.              }
  9756.  
  9757.  
  9758.  
  9759.  
  9760.  
  9761.  
  9762.  
  9763.  
  9764.  
  9765.  
  9766.  
  9767.  
  9768.  
  9769.  
  9770.  
  9771.  
  9772.                                      Page -161-
  9773.  
  9774.  
  9775.  
  9776.  
  9777.  
  9778.                           SCL1 Version 2.0 Reference Manual
  9779.  
  9780.  
  9781.                                                               ResetMouseCur
  9782.  
  9783.           Function:    ResetMouseCur
  9784.  
  9785.           Purpose:     Resets mouse cursor to a block character.
  9786.  
  9787.           Declaration: void ResetMouseCur(void);
  9788.  
  9789.           Returns:     Nothing
  9790.  
  9791.           Parameters:  None
  9792.  
  9793.           Example:
  9794.  
  9795.           include <scl1.h>
  9796.           #include <scl1clor.h>
  9797.  
  9798.           main()
  9799.           {
  9800.           GSSBox(WHITE_BLACK,0,0,0,24,79,1,0,0);
  9801.           InitMouse(IM_SHOW);
  9802.           if(MSE_MouseFl)
  9803.              {
  9804.              SetMouseCur('*');
  9805.              WriteScreenLen(WHITE_BLACK+HIGHLIGHT,23,2,40,"Mouse cursor
  9806.                             set to '*' character");
  9807.              WaitTime(300);
  9808.              ResetMouseCur();
  9809.              WriteScreenLen(WHITE_BLACK+HIGHLIGHT,23,2,40,"Mouse cursor
  9810.                             reset to normal");
  9811.              WaitTime(300);
  9812.              }
  9813.           else
  9814.              WriteScreenLen(WHITE_BLACK+HIGHLIGHT,23,2,40,"No mouse
  9815.                             installed.");
  9816.           }
  9817.  
  9818.  
  9819.  
  9820.  
  9821.  
  9822.  
  9823.  
  9824.  
  9825.  
  9826.  
  9827.  
  9828.  
  9829.  
  9830.  
  9831.                                      Page -162-
  9832.  
  9833.  
  9834.  
  9835.  
  9836.  
  9837.                           SCL1 Version 2.0 Reference Manual
  9838.  
  9839.  
  9840.                                                                  ScreenDump
  9841.  
  9842.           Function:    ScreenDump
  9843.  
  9844.           Purpose:     Displays a screendump array in the screen.  The
  9845.                        screendump array consists of characters followed by
  9846.                        its color attribute byte, terminated with a "0".
  9847.  
  9848.           Declaration: void ScreenDump(int Row, int Column, char *Array);
  9849.  
  9850.           Returns:     Nothing
  9851.            
  9852.           Parameters:
  9853.  
  9854.                    Row - row position for the array display (integer).
  9855.  
  9856.                 Column - column position for array display (integer).
  9857.  
  9858.                  Array - pointer to the array buffer (char).
  9859.  
  9860.           Example:
  9861.  
  9862.           #include <scl1.h>
  9863.  
  9864.           char Array[]={'A',7,'B',0x70,\n,'C',0x70,'D',7,0};
  9865.  
  9866.           main()
  9867.              {
  9868.              /* Each character is followed by its color attribute, a \n can
  9869.                 be used to indicate end of lines and a "0" must be used to
  9870.                 indicate the end of the array */
  9871.  
  9872.                 ScreenDump(10,10,Array); /* Write at line 10, column 10 */
  9873.                 GetKey();
  9874.  
  9875.                 ChangeDumpColor(0x70,7,Array);
  9876.                 ScreenDump(10,10,Array); /* Write at line 10, column 10 */
  9877.                 /* Change all character attributes 0x17 to 7 */
  9878.              }
  9879.  
  9880.           Notes:   The array must be null terminated, \n is used to
  9881.                    indicate end of lines.
  9882.  
  9883.           See also ChangeDumpColor.
  9884.  
  9885.  
  9886.  
  9887.  
  9888.  
  9889.  
  9890.                                      Page -163-
  9891.  
  9892.  
  9893.  
  9894.  
  9895.  
  9896.                           SCL1 Version 2.0 Reference Manual
  9897.  
  9898.  
  9899.                                                                  ScrollDown
  9900.  
  9901.           Function:    ScrollDown
  9902.  
  9903.           Purpose:     Scrolls down a screen area.
  9904.  
  9905.           Declaration: void ScrollDown(int Color, int UpperRow,
  9906.                             int LeftCol, int LowerRow, int RightCol,
  9907.                             int Scroll);
  9908.  
  9909.           Returns:     Nothing
  9910.  
  9911.           Parameters:
  9912.  
  9913.                  Color - color attribute of the area to be scrolled
  9914.                          (integer).
  9915.  
  9916.               UpperRow - upper row coordinate of the area to be scrolled
  9917.                          (integer).
  9918.  
  9919.                LeftCol - left column coordinate of the area to be scrolled
  9920.                          (integer).
  9921.  
  9922.               LowerRow - lower row coordinate of the area to be scrolled
  9923.                          (integer).
  9924.  
  9925.               RightCol - right column coordinate of the area to be scrolled
  9926.                          (integer).
  9927.  
  9928.                 Scroll - number of lines to scroll, if this variable is set
  9929.                          to "0" the whole window is cleared (integer).
  9930.  
  9931.           Example:
  9932.  
  9933.              ScrollDown(Color1,18,0,24,79,1);
  9934.  
  9935.  
  9936.  
  9937.  
  9938.  
  9939.  
  9940.  
  9941.  
  9942.  
  9943.  
  9944.  
  9945.  
  9946.  
  9947.  
  9948.  
  9949.                                      Page -164-
  9950.  
  9951.  
  9952.  
  9953.  
  9954.  
  9955.                           SCL1 Version 2.0 Reference Manual
  9956.  
  9957.  
  9958.                                                                  ScrollList
  9959.  
  9960.           Function:    ScrollList
  9961.  
  9962.           Purpose:     Displays a list of items enclosed in a box.  Only
  9963.                        the number of items desired are displayed.  The
  9964.                        function permits to scroll through the items using
  9965.                        the arrow keys or the mouse.  Pressing the ENTER key
  9966.                        or clicking the mouse in a highlighted item selects
  9967.                        the desired item.
  9968.  
  9969.           Declaration: int ScrollList(int NColor, int RColor,
  9970.                            int Row, int Col, int Lines,char **p);
  9971.  
  9972.           Returns:     The return value is the selected item's number or 
  9973.                        "-1" if the ESC key is pressed.
  9974.  
  9975.           Parameters:
  9976.  
  9977.           The scroll list information must be given in a null terminated
  9978.           char pointer array as follows:
  9979.  
  9980.                 char * ScrollDat[]
  9981.  
  9982.           The parameters passed to the function are:
  9983.  
  9984.                 NColor - color attribute for the normal display of items
  9985.                          (integer).
  9986.  
  9987.                 RColor - color attribute for the highlighted item
  9988.                          (integer).
  9989.  
  9990.                    Row - row position for the display of the first item of
  9991.                          the scroll list (integer).
  9992.  
  9993.                    Col - column position for the display of the first item
  9994.                          of the scroll list (integer).
  9995.  
  9996.                  Lines - number of lines to display in the box (integer).
  9997.  
  9998.                      p - char pointer to the ScrollList structure.
  9999.  
  10000.  
  10001.  
  10002.  
  10003.  
  10004.  
  10005.  
  10006.  
  10007.  
  10008.                                      Page -165-
  10009.  
  10010.  
  10011.  
  10012.  
  10013.  
  10014.                           SCL1 Version 2.0 Reference Manual
  10015.  
  10016.  
  10017.                                                                  ScrollList
  10018.  
  10019.           Example:
  10020.  
  10021.           #include <scl1.h>
  10022.           #include <scl1clor.h>
  10023.  
  10024.           int Color1=WHITE_BLACK;
  10025.           int Color2=BLACK_WHITE;
  10026.  
  10027.           /* ScrollList pointer structure */
  10028.                 char *Slist[]={
  10029.                 "Copy File   ",
  10030.                 "Sort File   ",
  10031.                 "Move File   ",
  10032.                 "Merge Files ",
  10033.                 "Delete File ",
  10034.                 "Tag File    ",
  10035.                 "Erase File  ",
  10036.                 "Append Files",
  10037.                 "Browse File ",
  10038.                 "Insert File ",
  10039.                 0};
  10040.  
  10041.           main()
  10042.              {
  10043.              int Selection;
  10044.  
  10045.              Selection=ScrollList(Color1,Color2,5,40,5,(int*)Slist);
  10046.              }
  10047.  
  10048.  
  10049.  
  10050.  
  10051.  
  10052.  
  10053.  
  10054.  
  10055.  
  10056.  
  10057.  
  10058.  
  10059.  
  10060.  
  10061.  
  10062.  
  10063.  
  10064.  
  10065.  
  10066.  
  10067.                                      Page -166-
  10068.  
  10069.  
  10070.  
  10071.  
  10072.  
  10073.                           SCL1 Version 2.0 Reference Manual
  10074.  
  10075.  
  10076.                                                                    ScrollUp
  10077.  
  10078.           Function:    ScrollUp
  10079.  
  10080.           Purpose:     Scrolls up a screen area.
  10081.  
  10082.           Declaration: void ScrollUp(int Color, int UpperRow, int LeftCol,
  10083.                             int LowerRow,int RightCol, int Scroll);
  10084.  
  10085.           Returns:     Nothing
  10086.  
  10087.           Parameters:
  10088.  
  10089.                  Color - color attribute of the area to be scrolled
  10090.                          (integer).
  10091.  
  10092.               UpperRow - upper row coordinate of the area to be scrolled
  10093.                          (integer).
  10094.  
  10095.                LeftCol - left column coordinate of the area to be scrolled
  10096.                          (integer).
  10097.  
  10098.               LowerRow - lower row coordinate of the area to be scrolled
  10099.                          (integer).
  10100.  
  10101.               RightCol - right column coordinate of the area to be scrolled
  10102.                          (integer).
  10103.  
  10104.                 Scroll - number of lines to scroll, if this variable is set
  10105.                          to "0" the whole window is cleared.
  10106.  
  10107.           Example:
  10108.  
  10109.              ScrollUp(Color1,18,0,24,79,1);
  10110.  
  10111.  
  10112.  
  10113.  
  10114.  
  10115.  
  10116.  
  10117.  
  10118.  
  10119.  
  10120.  
  10121.  
  10122.  
  10123.  
  10124.  
  10125.  
  10126.                                      Page -167-
  10127.  
  10128.  
  10129.  
  10130.  
  10131.  
  10132.                           SCL1 Version 2.0 Reference Manual
  10133.  
  10134.  
  10135.                                                                ScrollWindow
  10136.  
  10137.           Function:    ScrollWindow
  10138.  
  10139.           Purpose:     Displays a window with a list of items.  If the list
  10140.                        is larger than the window, or if a item's length is
  10141.                        larger than the display width, you can scroll the
  10142.                        display area both horizontally and vertically to
  10143.                        show all the information.  The window can have
  10144.                        scroll bars in both the right side and the bottom to
  10145.                        show the relative position of the text within the
  10146.                        window. The function permits you to scroll through
  10147.                        the items using the cursor keys or the mouse. 
  10148.                        Pressing the SPACEBAR or clicking the mouse after
  10149.                        pointing to an item tags or untags the desired item. 
  10150.                        This is a dialog type function.  To select an item
  10151.                        press the ENTER key or double click the mouse after
  10152.                        pointing to the item.
  10153.  
  10154.           Declaration: int ScrollWindow(int Message,SWData *p,...)
  10155.  
  10156.           Returns:     This is a dialog type function. See Appendix "E" for
  10157.                        a description of the general operation of these
  10158.                        functions.  The return value is a message described
  10159.                        in the Messages section.
  10160.  
  10161.           Parameters:
  10162.  
  10163.           The scroll window information must be given in a structure
  10164.           defined as type SWData. The structure elements are as follows:
  10165.  
  10166.           SWData type structure:
  10167.  
  10168.           typedef struct{
  10169.              int NColor;
  10170.              int RColor;
  10171.              int UpperRow;
  10172.              int LeftCol;
  10173.              int LowerRow;
  10174.              int RightCol;
  10175.              int FrameType;
  10176.              int ScrollBar;
  10177.              int BarColor;
  10178.              char **Array;
  10179.              char *TagArray;
  10180.              int TagColor;
  10181.              char *Title;
  10182.              int TitleColor;
  10183.              unsigned int *ExitKeys;
  10184.  
  10185.                                      Page -168-
  10186.  
  10187.  
  10188.  
  10189.  
  10190.  
  10191.                           SCL1 Version 2.0 Reference Manual
  10192.  
  10193.  
  10194.                                                                ScrollWindow
  10195.  
  10196.              unsigned int Lines;
  10197.              unsigned int Length;
  10198.              unsigned int TopLine;
  10199.              unsigned int Position;
  10200.              unsigned int FirstCol;
  10201.              int OldVBlock;
  10202.              int OldHBlock;
  10203.              int WindowLines;
  10204.              int WindowCols;
  10205.              int VScroll;
  10206.              int HScroll;
  10207.              unsigned int EventInfo;
  10208.              }SWData;
  10209.  
  10210.           where;
  10211.  
  10212.                 NColor - color attribute for normal display (integer).
  10213.  
  10214.                 RColor - color attributes for reversed display (integer).
  10215.  
  10216.               UpperRow - upper row coordinate of the window (integer).
  10217.  
  10218.                LeftCol - left column coordinate of the window (integer).
  10219.  
  10220.               LowerRow - lower row coordinate of the window (integer).
  10221.  
  10222.               RightCol - right column coordinate of the window (integer).
  10223.  
  10224.              FrameType - any of the frame types that can be used with the
  10225.                          Box or GSSbox functions (integer).
  10226.  
  10227.              ScrollBar - a flag to signal the function to draw scroll bars
  10228.                          to indicate the relative position of the cursor
  10229.                          within the array length (integer).
  10230.  
  10231.               BarColor - color attributes for the scroll bars (integer).
  10232.  
  10233.                  Array - pointer to a null terminated array of pointers to
  10234.                          be displayed.
  10235.  
  10236.               TagArray - an array that holds which item has been tagged. 
  10237.                          If a null pointer is specified the function will
  10238.                          not permit tagging.  An array element value of "0"
  10239.                          and "1"  indicate the status for untagged and
  10240.                          tagged (char).
  10241.  
  10242.  
  10243.  
  10244.                                      Page -169-
  10245.  
  10246.  
  10247.  
  10248.  
  10249.  
  10250.                           SCL1 Version 2.0 Reference Manual
  10251.  
  10252.  
  10253.                                                                ScrollWindow
  10254.  
  10255.               TagColor - color attributes to be used for displaying a
  10256.                          tagged item (integer).
  10257.  
  10258.                  Title - char pointer to text to be displayed in the
  10259.                          window's top row as a title.
  10260.  
  10261.             TitleColor - color attributes for the title's display
  10262.                          (integer).
  10263.  
  10264.               ExitKeys - an array of keys defined to exit the function
  10265.                          (unsigned integer).
  10266.  
  10267.                  Lines - structure element (used internally) that holds the
  10268.                          quantity of items in the array (unsigned integer).
  10269.  
  10270.                 Length - structure element (used internally) that holds the
  10271.                          length of the longest element in the ScrollWindow
  10272.                          array (unsigned integer).
  10273.  
  10274.                TopLine - structure element (used internally) that holds the
  10275.                          element number that is being displayed in the
  10276.                          first line of the window (unsigned integer).
  10277.  
  10278.               Position - structure element (used internally) that holds the
  10279.                          active position of the display (unsigned integer). 
  10280.                          Note this element should not be modified by the
  10281.                          calling program.
  10282.  
  10283.               FirstCol - structure element (used internally) that holds the
  10284.                          horizontal offset of the window.  If there is no
  10285.                          horizontal scroll, its value is "0".  When there
  10286.                          is scroll the value will be the number of columns
  10287.                          to the left of the first column displayed
  10288.                          (unsigned integer).
  10289.  
  10290.             OldVHBlock - structure element (used internally) that holds the
  10291.                          position of the vertical relative position
  10292.                          indicating scroll bar block (integer).
  10293.  
  10294.             OldVHBlock - structure element (used internally) that holds the
  10295.                          position of the horizontal relative position
  10296.                          indicating scroll bar block (integer).
  10297.  
  10298.            WindowLines - structure element (used internally) that holds the
  10299.                          number of lines in the List Window (integer).
  10300.  
  10301.  
  10302.  
  10303.                                      Page -170-
  10304.  
  10305.  
  10306.  
  10307.  
  10308.  
  10309.                           SCL1 Version 2.0 Reference Manual
  10310.  
  10311.  
  10312.                                                                ScrollWindow
  10313.  
  10314.             WindowCols - structure element (used internally) that holds the
  10315.                          number of columns in the List Window (integer).
  10316.  
  10317.                VScroll - structure element (used internally) that keeps
  10318.                          track if vertical scroll is required (integer).
  10319.  
  10320.                HScroll - structure element (used internally) that keeps
  10321.                          track if horizontal scroll is required (integer).
  10322.  
  10323.              EventInfo - information about the keys that have been pressed
  10324.                          (unsigned integer).
  10325.  
  10326.           Messages:
  10327.  
  10328.           The messages that can be sent to the ScrollWindow function are:
  10329.  
  10330.                         SW_INIT - Initialize the SWData structure to its
  10331.                                   default values.  The default values are:
  10332.  
  10333.                                     NColor - set to white characters in a
  10334.                                              black background or the normal
  10335.                                              color defined by calling
  10336.                                              SetDialogColors.
  10337.  
  10338.                                     RColor - set to black characters in a
  10339.                                              white background or the
  10340.                                              reversed color defined by
  10341.                                              calling SetDialogColors.
  10342.  
  10343.                                   LowerRow - one row less than the screen
  10344.                                              length.
  10345.  
  10346.                                   RightCol - one column less than the
  10347.                                              screen width.
  10348.  
  10349.                                  FrameType - set to frame type "1" (single
  10350.                                              line).
  10351.  
  10352.                                  ScrollBar - set to draw scroll bars.
  10353.  
  10354.                                   BarColor - set to black characters in a
  10355.                                              white background or the
  10356.                                              reversed color defined by
  10357.                                              calling SetDialogColors.
  10358.  
  10359.  
  10360.  
  10361.  
  10362.                                      Page -171-
  10363.  
  10364.  
  10365.  
  10366.  
  10367.  
  10368.                           SCL1 Version 2.0 Reference Manual
  10369.  
  10370.  
  10371.                                                                ScrollWindow
  10372.  
  10373.                                   TagColor - set to black characters in a
  10374.                                              white background or the
  10375.                                              reversed color defined by
  10376.                                              calling SetDialogColors.
  10377.  
  10378.                                 TitleColor - set to white characters in a
  10379.                                              black background or the normal
  10380.                                              color defined by calling
  10381.                                              SetDialogColors.
  10382.  
  10383.                                  OldVBlock - set to "1".
  10384.  
  10385.                                  OldHBlock - set to "1".
  10386.  
  10387.                         SW_DRAW - display the Scroll Window with the
  10388.                                   current information.
  10389.  
  10390.                        SW_WRITE - write the items to the screen.
  10391.  
  10392.                       SW_ACTIVE - browse through the displayed items and
  10393.                                   permit the selection or tagging of them
  10394.                                   using the cursor movement keys as
  10395.                                   follows:
  10396.  
  10397.                          Key                      action
  10398.  
  10399.                        Up Arrow         cursor one item up.
  10400.                        Down Arrow       cursor one item down.
  10401.                        END              cursor to end of file list.
  10402.                        HOME             cursor to beginning of list.
  10403.                        Page Up          cursor one screen up.
  10404.                        Page Down        cursor one screen down.
  10405.  
  10406.                  SW_DRAW_BORDER - draw the Scroll Window's border.
  10407.  
  10408.               SW_POSITION_BEGIN - move cursor to the first item.
  10409.  
  10410.                 SW_POSITION_END - move cursor to the last item.
  10411.  
  10412.                  SW_POSITION_UP - move cursor to the previous item.
  10413.  
  10414.                SW_POSITION_DOWN - move cursor to the next item.
  10415.  
  10416.                 SW_SET_POSITION - move cursor to a specific item.  The item
  10417.                                   number is passed as a parameter.
  10418.  
  10419.                          SW_CLS - clear the list window.
  10420.  
  10421.                                      Page -172-
  10422.  
  10423.  
  10424.  
  10425.  
  10426.  
  10427.                           SCL1 Version 2.0 Reference Manual
  10428.  
  10429.  
  10430.                                                                ScrollWindow
  10431.  
  10432.                  SW_CHECK_MOUSE - check if the mouse has been clicked after
  10433.                                   pointing to the area defined by the
  10434.                                   function.
  10435.  
  10436.                      SW_UWRITE -  recalculate all the internal variables
  10437.                                   but do not write the Scroll Window unless
  10438.                                   the display contents has changed.
  10439.  
  10440.                        SW_RESET - when this message is sent the position
  10441.                                   variables are reset to the default value. 
  10442.                                   If the exit keys have not been defined
  10443.                                   they are set to the default exit keys.
  10444.  
  10445.           The messages returned by ScrollWindow are:
  10446.  
  10447.                   SW_NULL_ARRAY - no item array has been defined.
  10448.  
  10449.                           SW_OK - the requested action has been performed.
  10450.  
  10451.                     SW_EXIT_KEY - a defined exit key has been pressed.
  10452.  
  10453.                  SW_MOUSE_EVENT - the mouse has been clicked but it has not
  10454.                                   been pointed to the area defined by the
  10455.                                   function.
  10456.  
  10457.                   SW_BUFFER_END - you have requested to move the cursor
  10458.                                   passed the last item.
  10459.  
  10460.                 SW_BUFFER_BEGIN - you have requested to move the cursor up
  10461.                                   and you have the first item active.
  10462.  
  10463.                  SW_ILLEGAL_KEY - an undefined key has been pressed.
  10464.  
  10465.             SW_ILLEGAL_POSITION - you have requested to move the cursor to
  10466.                                   an invalid position.
  10467.  
  10468.                 SW_NEW_POSITION - the cursor position has been updated.
  10469.  
  10470.                 SW_MOUSE_SELECT - one of the elements have been selected by
  10471.                                   double clicking the mouse.
  10472.  
  10473.                     SW_MY_MOUSE - response to a SW_CHECK_MOUSE message if
  10474.                                   the mouse has been clicked after pointing
  10475.                                   to the area defined by the function.
  10476.  
  10477.  
  10478.  
  10479.  
  10480.                                      Page -173-
  10481.  
  10482.  
  10483.  
  10484.  
  10485.  
  10486.                           SCL1 Version 2.0 Reference Manual
  10487.  
  10488.  
  10489.                                                                ScrollWindow
  10490.  
  10491.                 SW_NEW_MOUSEPOS - you have moved the cursor by clicking the
  10492.                                   mouse after pointing to an item.
  10493.  
  10494.                   SW_BLOCK_MARK - this message is returned when you have
  10495.                                   marked a series of items by dragging you
  10496.                                   mouse after clicking at an item.
  10497.  
  10498.           Example:
  10499.  
  10500.           #include <scl1.h>
  10501.           #include <scl1clor.h>
  10502.           #include <scl1keys.h>
  10503.  
  10504.           int Color1=WHITE_BLACK;
  10505.  
  10506.           char *Info={"",
  10507.           " BigCursor         - Changes the cursor size to a block.",
  10508.           "",
  10509.           " Center            - Centers a string horizontally.",
  10510.           "",
  10511.           " Cls               - Clears a screen area.",
  10512.           "",
  10513.           " CursorOff         - Turns the cursor off.",
  10514.           "",
  10515.           " CursorOn          - Turns the cursor on (cursor visible).",
  10516.           "",
  10517.           " DrawItemList      - Draws an item list to the screen.",
  10518.           "",
  10519.           " GetCurLine        - Returns the current cursor row position.",
  10520.           "",
  10521.           " GetCurSize        - Returns the current cursor size.",
  10522.           "",
  10523.           " ScrollUp          - Scrolls up a screen area.",
  10524.           "",
  10525.           " SetCurPos         - Sets the cursor position.",
  10526.           "",
  10527.           " SetCurSize        - Sets the cursor size.",
  10528.           "",
  10529.           " SetVideoMode      - Sets the video mode.",
  10530.           "",
  10531.           " SetVideoPage      - Sets the video page.",
  10532.           "",
  10533.           " SetVideo25        - Sets the display mode to 25 lines.",
  10534.           "",
  10535.           " Shadow            - Draws a shadow effect to a screen area.",
  10536.           "",
  10537.  
  10538.  
  10539.                                      Page -174-
  10540.  
  10541.  
  10542.  
  10543.  
  10544.  
  10545.                           SCL1 Version 2.0 Reference Manual
  10546.  
  10547.  
  10548.                                                                ScrollWindow
  10549.  
  10550.           " Video             - Detects if the video adapter in use is",
  10551.           "                     either Monochrome, CGA or EGA.",
  10552.           "",
  10553.           " WriteCharBlock    - Writes a block of characters.",
  10554.           "",
  10555.           " WriteOffset       - Writes a character at a given offset.",
  10556.           "",
  10557.           " Window            - Saves, clears and restores a window.",
  10558.           ,0};
  10559.  
  10560.           unsigned int ExitK[]={ESC,ENTER,0};
  10561.  
  10562.           main
  10563.           {
  10564.           int i;
  10565.           SWData sw;  /* Use the default Scroll Window structure */
  10566.  
  10567.           CursorOff();                  /* Turn of cursor         */
  10568.           InitMouse(IM_SHOW);
  10569.           Cls(Color1,CLS_ALL);
  10570.           ScrollWindow(SW_INIT,&sw);    /* Initialize Scroll Window */
  10571.  
  10572.           sw.UpperRow=2;                /* Change default window size */
  10573.           sw.LeftCol=4;
  10574.           sw.LowerRow=22;
  10575.           sw.RightCol=75;
  10576.           sw.NColor=0x70;               /* Change default color     */
  10577.           sw.RColor=0x7f;               /* Do not show scroll bar   */
  10578.           sw.ExitKeys=ExitK;
  10579.           sw.Array=Info;
  10580.           sw.Title="[ Information ]";
  10581.           sw.TitleColor=0x70;
  10582.           SetShadowColor(8);            /* We want an Xor shadow    */
  10583.           Shadow(0,2,4,22,75);          /* Around Scroll Window     */
  10584.           ScrollWindow(SW_DRAW,&sw);    /* Now, draw the Scroll Window */
  10585.             do                          /* Browse window until an exit key
  10586.                                         is pressed*/
  10587.             {
  10588.               i=ScrollWindow(SW_ACTIVE,&sw);
  10589.  
  10590.             }while(i!=SW_EXIT_KEY && i!=SW_MOUSE_EVENT);
  10591.           CursorOn();
  10592.           }
  10593.  
  10594.  
  10595.  
  10596.  
  10597.  
  10598.                                      Page -175-
  10599.  
  10600.  
  10601.  
  10602.  
  10603.  
  10604.                           SCL1 Version 2.0 Reference Manual
  10605.  
  10606.  
  10607.                                                                      Select
  10608.  
  10609.           Function:    Select
  10610.  
  10611.           Purpose:     Will permit the display of various options and let
  10612.                        the user to select one of them.  To move among
  10613.                        options the user can use the arrow keys.  A
  10614.                        selection can be made by clicking the left mouse
  10615.                        button after pointing to the desired option or by
  10616.                        pressing a key defined as an exit key.  The active
  10617.                        option will be displayed with a check mark between
  10618.                        parenthesis (√).  This is a dialog type function
  10619.                        that can either be used alone or as one of the field
  10620.                        types for the fields option.
  10621.  
  10622.           Declaration: int Select(int Message,SData1 *sd1,SData2 *sd2)
  10623.  
  10624.           Returns:     This is a dialog type function. See Appendix "E" for
  10625.                        a description of the general operation of these
  10626.                        functions.  The return value is a message described
  10627.                        in the Messages section.
  10628.  
  10629.           Parameters:
  10630.  
  10631.           The options must be passed as a null terminated array of
  10632.           structures of the type SData1, one array element for each select
  10633.           option:
  10634.  
  10635.           typedef struct{
  10636.              int Row;
  10637.              int Col;
  10638.              char *String;
  10639.              }SData1;
  10640.  
  10641.           where,
  10642.  
  10643.                    Row - row position where the option is displayed
  10644.                          (integer).
  10645.  
  10646.                    Col - column position where the option is displayed
  10647.                          (integer).
  10648.  
  10649.                 String - char pointer to the text used to identify the
  10650.                          option.
  10651.  
  10652.  
  10653.  
  10654.  
  10655.  
  10656.  
  10657.                                      Page -176-
  10658.  
  10659.  
  10660.  
  10661.  
  10662.  
  10663.                           SCL1 Version 2.0 Reference Manual
  10664.  
  10665.  
  10666.                                                                      Select
  10667.  
  10668.           The general information about the Select options are included in
  10669.           a structure type SData2, as follows:
  10670.  
  10671.           typedef struct{
  10672.              int Color;
  10673.              int PRow;
  10674.              int PCol;
  10675.              char *Prompt;
  10676.              unsigned int *ExitKeys;
  10677.              int Options;
  10678.              int Position;
  10679.              unsigned int EventInfo;
  10680.              }SData2;
  10681.  
  10682.           where,
  10683.  
  10684.                  Color - color attributes for the display of the select
  10685.                          options (integer).
  10686.  
  10687.                   PRow - row position where to display an optional prompt
  10688.                          or select options title (integer).
  10689.  
  10690.                   PCol - column position where to display an optional
  10691.                          prompt or select options title (integer).
  10692.  
  10693.                 Prompt - char pointer to an optional prompt or select
  10694.                          options title.
  10695.  
  10696.               ExitKeys - array of keys defined as exit keys (unsigned
  10697.                          integer).
  10698.  
  10699.                Options - number of options available (integer).
  10700.  
  10701.               Position - default selection (integer).
  10702.  
  10703.              EventInfo - this structure element will hold the last illegal
  10704.                          or exit key pressed (unsigned integer).
  10705.  
  10706.           Messages:
  10707.  
  10708.           The messages that can be sent to the Select are:
  10709.  
  10710.                          S_INIT - initialize the SData2 structure to NULL
  10711.                                   (the SData1 structure must be initialized
  10712.                                   with the position and text information)
  10713.                                   and set the following default values:
  10714.  
  10715.  
  10716.                                      Page -177-
  10717.  
  10718.  
  10719.  
  10720.  
  10721.  
  10722.                           SCL1 Version 2.0 Reference Manual
  10723.  
  10724.  
  10725.                                                                      Select
  10726.  
  10727.                                 Color - set to black characters in a white
  10728.                                         background or the reversed color
  10729.                                         defined by calling SetDialogColors.
  10730.  
  10731.                              ExitKeys - ENTER, ESC, TAB and SHIFT TAB.
  10732.  
  10733.                          S_DRAW - draws the Select display.
  10734.  
  10735.                        S_ACTIVE - activates the function.
  10736.  
  10737.                   S_CHECK_MOUSE - check if the mouse has been clicked after
  10738.                                   pointing to the area defined by the
  10739.                                   function.
  10740.  
  10741.                         S_RESET - when this message is sent the position
  10742.                                   variables are reset to the default value. 
  10743.                                   If the exit keys have not been defined
  10744.                                   they are set to the default exit keys.
  10745.  
  10746.           The following messages can be returned by Select:
  10747.  
  10748.                    S_NULL_ARRAY - no select item array has been defined.
  10749.  
  10750.                            S_OK - action requested was performed.
  10751.  
  10752.                      S_EXIT_KEY - a key defined as an exit key has been
  10753.                                   pressed.
  10754.  
  10755.                   S_MOUSE_EVENT - the mouse has been clicked but it has not
  10756.                                   been pointed to the area defined by the
  10757.                                   function.
  10758.  
  10759.                   S_ILLEGAL_KEY - an illegal key has been pressed.
  10760.  
  10761.                  S_NEW_POSITION - the cursor position has been updated.
  10762.  
  10763.                      S_MY_MOUSE - response to a S_CHECK_MOUSE message if
  10764.                                   the mouse has been clicked after pointing
  10765.                                   to the area defined by the function.
  10766.  
  10767.  
  10768.  
  10769.  
  10770.  
  10771.  
  10772.  
  10773.  
  10774.  
  10775.                                      Page -178-
  10776.  
  10777.  
  10778.  
  10779.  
  10780.  
  10781.                           SCL1 Version 2.0 Reference Manual
  10782.  
  10783.  
  10784.                                                                      Select
  10785.  
  10786.           Example:
  10787.  
  10788.           #include <scl1.h>
  10789.           #include <scl1keys.h>
  10790.           #include <scl1clor.h>
  10791.  
  10792.           unsigned int ExitKeys[]={ESC,ENTER,0};
  10793.  
  10794.           SData1 sd1[]={
  10795.              12,35,"Male",
  10796.              13,35,"Female",
  10797.              0};
  10798.  
  10799.           SData2 sd2={WHITE_BLACK,10,32,"Enter your sex:",ExitKeys,0,0,0};
  10800.  
  10801.           main()
  10802.           {
  10803.           int Mess;
  10804.  
  10805.           InitVideo();
  10806.           Select(S_RESET,sd1,&sd2);
  10807.           Select(S_DRAW,sd1,&sd2);
  10808.           do
  10809.              {
  10810.              Mess=Select(S_ACTIVE,sd1,&sd2);
  10811.              }while(Mess!=S_EXIT_KEY);
  10812.           }
  10813.  
  10814.  
  10815.  
  10816.  
  10817.  
  10818.  
  10819.  
  10820.  
  10821.  
  10822.  
  10823.  
  10824.  
  10825.  
  10826.  
  10827.  
  10828.  
  10829.  
  10830.  
  10831.  
  10832.  
  10833.  
  10834.                                      Page -179-
  10835.  
  10836.  
  10837.  
  10838.  
  10839.  
  10840.                           SCL1 Version 2.0 Reference Manual
  10841.  
  10842.  
  10843.                                                                   SetCurPos
  10844.  
  10845.           Function:    SetCurPos
  10846.  
  10847.           Purpose:     Sets the cursor position.
  10848.  
  10849.           Declaration: void SetCurPos(int Row, int Col);
  10850.  
  10851.           Returns:     Nothing
  10852.  
  10853.           Parameters:
  10854.  
  10855.                    Row - the desired row position coordinate (integer).
  10856.  
  10857.                    Col - the desired column position coordinate (integer).
  10858.  
  10859.           Example:
  10860.  
  10861.           #include <scl1.h>
  10862.           #include <scl1clor.h>
  10863.  
  10864.           main()
  10865.              {
  10866.              InitVideo();
  10867.  
  10868.              SetCurPos(10,20);
  10869.              printf("Cursor was moved to position 10,20");
  10870.              WaitTime(200);
  10871.              SetCurPos(20,40);
  10872.              printf("Cursor was moved to position 20,40");
  10873.              WaitTime(200);
  10874.              SetCurPos(0,0);
  10875.              printf("Cursor was moved to position 0,0");
  10876.              }
  10877.  
  10878.  
  10879.  
  10880.  
  10881.  
  10882.  
  10883.  
  10884.  
  10885.  
  10886.  
  10887.  
  10888.  
  10889.  
  10890.  
  10891.  
  10892.  
  10893.                                      Page -180-
  10894.  
  10895.  
  10896.  
  10897.  
  10898.  
  10899.                           SCL1 Version 2.0 Reference Manual
  10900.  
  10901.  
  10902.                                                                  SetCurSize
  10903.  
  10904.           Function:    SetCurSize
  10905.  
  10906.           Purpose:     Sets the cursor size.
  10907.  
  10908.           Declaration: void SetCurSize(int CursorSize);
  10909.  
  10910.           Returns:     Nothing
  10911.  
  10912.           Parameters:
  10913.  
  10914.             CursorSize - the desired cursor size, an unsigned integer value
  10915.                          that contains both the scan start and end line. 
  10916.                          To determine this value use the following formula:
  10917.                          Size = StartLine*256+EndLine.  The start and end
  10918.                          lines for MONOCHROME monitors are from "0" to "13"
  10919.                          and for COLOR monitors from "0" to "7".
  10920.  
  10921.           Example:
  10922.  
  10923.           #include <scl1.h>
  10924.           #include <scl1clor.h>
  10925.  
  10926.           main()
  10927.           {
  10928.           int topline,bottomline;
  10929.  
  10930.           InitVideo();
  10931.           topline=0;
  10932.  
  10933.           if(Video()==COLOR)
  10934.              bottomline=7;
  10935.           else
  10936.              bottomline=13;
  10937.           printf("\nYour cursor will start growing: ");
  10938.           for(topline=bottomline-1;topline > 0;--topline)
  10939.              {
  10940.              SetCurSize(topline * 256 + bottomline);
  10941.              WaitTime(50);
  10942.              }
  10943.  
  10944.           printf("\nYour cursor will now return to normal: ");
  10945.           for(;topline < bottomline;++topline)
  10946.              {
  10947.              SetCurSize(topline * 256 + bottomline);
  10948.              WaitTime(50);
  10949.              }
  10950.           }
  10951.  
  10952.                                      Page -181-
  10953.  
  10954.  
  10955.  
  10956.  
  10957.  
  10958.                           SCL1 Version 2.0 Reference Manual
  10959.  
  10960.  
  10961.                                                              SetDialogColor
  10962.  
  10963.           Function:    SetDialogColor
  10964.  
  10965.           Purpose:     Lets you define the colors for the dialog type
  10966.                        functions.  Sets global variables D_NColor, which
  10967.                        holds the normal color attributes, D_RColor, which
  10968.                        holds the reversed color attributes and D_HColor,
  10969.                        which holds the highlight color attributes. If this
  10970.                        function is not called the variables will contain
  10971.                        the following default values; D_NColor=0x7,
  10972.                        D_RColor=0x70 and D_HColor=0x0f.
  10973.  
  10974.           Declaration: void SetDialogColor(int NColor,int RColor,
  10975.                             int HColor);
  10976.  
  10977.           Returns:     Nothing
  10978.  
  10979.           Parameters:
  10980.  
  10981.                 NColor - normal color attributes for the dialog functions
  10982.                          (integer).
  10983.  
  10984.                 RColor - reversed color attributes for the dialog functions
  10985.                          (integer).
  10986.  
  10987.                 HColor - highlight color attributes for the dialog
  10988.                          functions (integer).
  10989.  
  10990.           Example:
  10991.  
  10992.           #include <scl1.h>
  10993.           #include <scl1clor.h>
  10994.  
  10995.           int Color1=WHITE_BLUE;
  10996.           int Color2=BLUE_WHITE;
  10997.           int Color3=WHITE_BLUE+HIGHLIGHT;
  10998.  
  10999.           main()
  11000.              {
  11001.              SetDialogColor(Color1,Color2,Color3);
  11002.              .
  11003.              .
  11004.              /* Will set the color attributes for subsequent calls to
  11005.                 dialog type functions to Color1, Color3 and Color3. */
  11006.              }
  11007.  
  11008.  
  11009.  
  11010.  
  11011.                                      Page -182-
  11012.  
  11013.  
  11014.  
  11015.  
  11016.  
  11017.                           SCL1 Version 2.0 Reference Manual
  11018.  
  11019.  
  11020.                                                            SetErrorBoxColor
  11021.  
  11022.           Function:    SetErrorBoxColor
  11023.  
  11024.           Purpose:     Lets you define the color for the Error Box
  11025.                        function.
  11026.  
  11027.           Declaration: void SetErrorBoxColor(int UColor)
  11028.  
  11029.           Returns:     Nothing
  11030.  
  11031.           Parameters:
  11032.  
  11033.                 UColor - color attribute for Error Box messages (integer).
  11034.  
  11035.           Example:
  11036.  
  11037.           #include <scl1.h>
  11038.           #include <scl1clor.h>
  11039.  
  11040.           int Color1=RED_WHITE;
  11041.  
  11042.           main()
  11043.              {
  11044.              SetErrorBoxColor(Color1);
  11045.              .
  11046.              .
  11047.              /* Will set a color for subsequent calls to the Error Box
  11048.                 function to Color1. */
  11049.              }
  11050.  
  11051.           See also ErroBox.
  11052.  
  11053.  
  11054.  
  11055.  
  11056.  
  11057.  
  11058.  
  11059.  
  11060.  
  11061.  
  11062.  
  11063.  
  11064.  
  11065.  
  11066.  
  11067.  
  11068.  
  11069.  
  11070.                                      Page -183-
  11071.  
  11072.  
  11073.  
  11074.  
  11075.  
  11076.                           SCL1 Version 2.0 Reference Manual
  11077.  
  11078.  
  11079.                                                                 SetFileMode
  11080.  
  11081.           Function:    SetFileMode
  11082.  
  11083.           Purpose:     Sets a file's attributes (system, hidden, read only,
  11084.                        etc.).
  11085.  
  11086.           Declaration: int SetFileMode(char *Filename, int NewMode);
  11087.  
  11088.           Returns:     The return value is "0" if no error occurs or the
  11089.                        DOS error code if an error occurs.  (See Appendix
  11090.                        "A", FILE FUNCTIONS, for more information).
  11091.  
  11092.           Parameters: 
  11093.  
  11094.           A mask has been defined in SCL1.H (see GetFileMode): They can be
  11095.           ored to "add" several attributes.
  11096.  
  11097.           Example:
  11098.  
  11099.           #include <scl1.h>
  11100.  
  11101.           char Filename[]="FILE.1";
  11102.  
  11103.           main()
  11104.           {
  11105.           int handle;
  11106.           unsigned int FMode;
  11107.  
  11108.           if(CreateFile(Filename,&handle,F_ARCHIVE))
  11109.              exit(-1);
  11110.           if(GetFileMode(Filename,&FMode))
  11111.              exit(-1);
  11112.           PrintFMode(FMode);
  11113.           if(SetFileMode(Filename,F_READ_ONLY | F_SYSTEM | F_HIDDEN))
  11114.              exit(-1);
  11115.           if(GetFileMode(Filename,&FMode))
  11116.              exit(-1);
  11117.           PrintFMode(FMode);
  11118.           if(SetFileMode(Filename,F_ARCHIVE))
  11119.              exit(-1);
  11120.           DeleteFile(Filename);
  11121.           }
  11122.  
  11123.  
  11124.  
  11125.  
  11126.  
  11127.  
  11128.  
  11129.                                      Page -184-
  11130.  
  11131.  
  11132.  
  11133.  
  11134.  
  11135.                           SCL1 Version 2.0 Reference Manual
  11136.  
  11137.  
  11138.                                                                 SetFileMode
  11139.  
  11140.           PrintFMode(unsigned int FMode)
  11141.           {
  11142.           printf("\nFile attributtes:\n\n");
  11143.           if(FMode & F_READ_ONLY)
  11144.              printf("\tRead Only\n");
  11145.           if(FMode & F_HIDDEN)
  11146.              printf("\tHidden\n");
  11147.           if(FMode & F_SYSTEM)
  11148.              printf("\tSystem\n");
  11149.           if(FMode & F_ARCHIVE)
  11150.              printf("\tArchive\n");
  11151.           }
  11152.  
  11153.  
  11154.  
  11155.  
  11156.  
  11157.  
  11158.  
  11159.  
  11160.  
  11161.  
  11162.  
  11163.  
  11164.  
  11165.  
  11166.  
  11167.  
  11168.  
  11169.  
  11170.  
  11171.  
  11172.  
  11173.  
  11174.  
  11175.  
  11176.  
  11177.  
  11178.  
  11179.  
  11180.  
  11181.  
  11182.  
  11183.  
  11184.  
  11185.  
  11186.  
  11187.  
  11188.                                      Page -185-
  11189.  
  11190.  
  11191.  
  11192.  
  11193.  
  11194.                           SCL1 Version 2.0 Reference Manual
  11195.  
  11196.  
  11197.                                                                 SetHorLimit
  11198.  
  11199.           Function:    SetHorLimit
  11200.  
  11201.           Purpose:     Sets the minimum and maximum mouse horizontal
  11202.                        coordinates.
  11203.  
  11204.           Declaration: void SetHorLimit(int Minimum,int Maximum);
  11205.  
  11206.           Returns:     Nothing
  11207.  
  11208.           Parameters:
  11209.  
  11210.                Minimum - integer value indicating the minimum horizontal
  11211.                          coordinate.
  11212.  
  11213.                Maximum - integer value indicating the maximum horizontal
  11214.                          coordinate.
  11215.  
  11216.           Example:
  11217.  
  11218.           #include <scl1.h>
  11219.           #include <scl1clor.h>
  11220.  
  11221.           main()
  11222.           {
  11223.           InitMouse(IM_SHOW);
  11224.           if(MSE_MouseFl)
  11225.              {
  11226.              SetHorLimit(39,39);
  11227.              printf("Mouse movement has been limited to column 39, click
  11228.                     mouse to exit\n");
  11229.              while(!MSE_LPress);
  11230.              }
  11231.           else
  11232.              printf("No mouse installed\n");
  11233.           }
  11234.  
  11235.           See also SetVerLimit.
  11236.  
  11237.  
  11238.  
  11239.  
  11240.  
  11241.  
  11242.  
  11243.  
  11244.  
  11245.  
  11246.  
  11247.                                      Page -186-
  11248.  
  11249.  
  11250.  
  11251.  
  11252.  
  11253.                           SCL1 Version 2.0 Reference Manual
  11254.  
  11255.  
  11256.                                                              SetInt24Colors
  11257.  
  11258.           Function:    SetInt24Colors
  11259.  
  11260.           Purpose:     Lets you define the color for the error display box
  11261.                        used by the TrapInt24 function.
  11262.  
  11263.           Declaration: void SetInt24Colors(int NColor, int RColor);
  11264.  
  11265.           Returns:     Nothing
  11266.  
  11267.           Parameters:
  11268.  
  11269.                 NColor - normal color attribute for the TrapInt24 error
  11270.                          display (integer).
  11271.  
  11272.                 RColor - reversed color attribute for the TrapInt24 error
  11273.                          display (integer).
  11274.  
  11275.           Example:
  11276.  
  11277.           #include <scl1.h>
  11278.           #include <scl1clor.h>
  11279.  
  11280.           int Color1=WHITE_BLACK;
  11281.           int Color2=BLACK_WHITE;
  11282.  
  11283.           main()
  11284.              {
  11285.              SetInt24Colors(Color1,Color2);
  11286.              /* Will set the colors for calls to the TrapInt24 function to
  11287.                 Color1 and Color2. */
  11288.              .
  11289.              .
  11290.              }
  11291.  
  11292.  
  11293.  
  11294.  
  11295.  
  11296.  
  11297.  
  11298.  
  11299.  
  11300.  
  11301.  
  11302.  
  11303.  
  11304.  
  11305.  
  11306.                                      Page -187-
  11307.  
  11308.  
  11309.  
  11310.  
  11311.  
  11312.                           SCL1 Version 2.0 Reference Manual
  11313.  
  11314.  
  11315.                                                                 SetMouseCur
  11316.  
  11317.           Function:    SetMouseCur
  11318.  
  11319.           Purpose:     Sets mouse cursor.  Any valid character can be used
  11320.                        as the mouse cursor.
  11321.  
  11322.           Declaration: void SetMouseCur(int Character);
  11323.  
  11324.           Returns:     Nothing
  11325.  
  11326.           Parameters:
  11327.  
  11328.              Character - any valid character to be used as the mouse cursor
  11329.                          (integer).
  11330.  
  11331.           Example:
  11332.  
  11333.           #include <scl1.h>
  11334.           #include <scl1clor.h>
  11335.  
  11336.           main()
  11337.           {
  11338.           GSSBox(WHITE_BLACK,0,0,0,24,79,1,0,0);
  11339.           InitMouse(IM_SHOW);
  11340.           if(MSE_MouseFl)
  11341.              {
  11342.              SetMouseCur('*');
  11343.              WriteScreenLen(WHITE_BLACK+HIGHLIGHT,23,2,40,"Mouse cursor
  11344.                             set to '*' character");
  11345.              WaitTime(300);
  11346.              ResetMouseCur();
  11347.              WriteScreenLen(WHITE_BLACK+HIGHLIGHT,23,2,40,"Mouse cursor
  11348.                             reset to normal");
  11349.              WaitTime(300);
  11350.              }
  11351.           else
  11352.              WriteScreenLen(WHITE_BLACK+HIGHLIGHT,23,2,40,"No mouse
  11353.                             installed.");
  11354.           }
  11355.  
  11356.  
  11357.  
  11358.  
  11359.  
  11360.  
  11361.  
  11362.  
  11363.  
  11364.  
  11365.                                      Page -188-
  11366.  
  11367.  
  11368.  
  11369.  
  11370.  
  11371.                           SCL1 Version 2.0 Reference Manual
  11372.  
  11373.  
  11374.                                                                 SetMouseIsr
  11375.  
  11376.           Function:    SetMouseIsr
  11377.  
  11378.           Purpose:     Sets an Interrupt service routine that is called
  11379.                        whenever the mouse moves or any of its buttons is
  11380.                        pressed or released.
  11381.  
  11382.           Declaration: void SetMouseIsr(void);
  11383.  
  11384.           Returns:     Nothing
  11385.  
  11386.           The following variables are set according to mouse status:
  11387.  
  11388.              MSE_LPress is set to "1" when the left button is pressed.
  11389.  
  11390.              MSE_LpX and MSE_LpY are set to the X and Y position when the
  11391.              left button is pressed.
  11392.  
  11393.              MSE_LRel, MSE_LrX and MSE_LrY are set to the X and Y position
  11394.              when the left button is released.
  11395.  
  11396.              MSE_RPress is set to "1" when the right button is pressed.
  11397.  
  11398.              MSE_RpX and MSE_RpY  are set to the X and Y position when the
  11399.              right button is pressed.
  11400.  
  11401.              MSE_RRel, MSE_RrX, and MSE_RrY are set to the X and Y position
  11402.              when the right button is released.
  11403.  
  11404.              MSE_Move is set to "1" when the mouse is moved.
  11405.  
  11406.              MSE_MoveX and MSE_MoveY hold the actual X and Y mouse
  11407.              position.
  11408.  
  11409.              MSE_DoubleClick is set to "1" when you double click the left
  11410.              mouse button.
  11411.  
  11412.              MSE_MouseFl is set to "1" when the mouse driver is present.
  11413.  
  11414.              Before ending your program you must Reset the mouse using
  11415.              ResetMouse or disable the interrupt service routine using
  11416.              DisableMouseIsr or ResetMouse.
  11417.  
  11418.  
  11419.  
  11420.  
  11421.  
  11422.  
  11423.  
  11424.                                      Page -189-
  11425.  
  11426.  
  11427.  
  11428.  
  11429.  
  11430.                           SCL1 Version 2.0 Reference Manual
  11431.  
  11432.  
  11433.                                                                 SetMouseIsr
  11434.  
  11435.           Example:
  11436.  
  11437.           #include <scl1.h>
  11438.  
  11439.           main()
  11440.              {
  11441.  
  11442.              /* do we have a mouse? */
  11443.              if(CheckMouse())
  11444.                 {
  11445.                 /* Yes */
  11446.                 ResetMouse();  /* reset mouse */
  11447.                 SetMouseIsr(); /* initialize ISR */
  11448.                 ShowMouse();   /* cursor on */
  11449.                 }
  11450.              .
  11451.              .
  11452.              .
  11453.              ResetMouse();  /* reset mouse before exit */
  11454.              }
  11455.  
  11456.           See also InitMouse
  11457.  
  11458.  
  11459.  
  11460.  
  11461.  
  11462.  
  11463.  
  11464.  
  11465.  
  11466.  
  11467.  
  11468.  
  11469.  
  11470.  
  11471.  
  11472.  
  11473.  
  11474.  
  11475.  
  11476.  
  11477.  
  11478.  
  11479.  
  11480.  
  11481.  
  11482.  
  11483.                                      Page -190-
  11484.  
  11485.  
  11486.  
  11487.  
  11488.  
  11489.                           SCL1 Version 2.0 Reference Manual
  11490.  
  11491.  
  11492.                                                                 SetMousePos
  11493.  
  11494.           Function:    SetMousePos
  11495.  
  11496.           Purpose:     Sets the mouse cursor position.
  11497.  
  11498.           Declaration: void SetMousePos(int X, int Y);
  11499.  
  11500.           Returns:     Nothing
  11501.  
  11502.           Parameters:
  11503.  
  11504.                      X - integer value indicating the horizontal
  11505.                          coordinate.
  11506.  
  11507.                      Y - integer value indicating the vertical coordinate.
  11508.  
  11509.           Example:
  11510.  
  11511.           #include <scl1.h>
  11512.           #include <scl1clor.h>
  11513.  
  11514.           main()
  11515.           {
  11516.           GSSBox(WHITE_BLACK,0,0,0,24,79,1,0,0);
  11517.           InitMouse(IM_SHOW);
  11518.           if(MSE_MouseFl)
  11519.              {
  11520.              SetMousePos(1,1);
  11521.              WriteScreen(WHITE_BLACK+HIGHLIGHT,23,2,"Mouse cursor position
  11522.                         (X,Y) = 1,1");
  11523.              WaitTime(200);
  11524.              SetMousePos(39,12);
  11525.              WriteScreen(WHITE_BLACK+HIGHLIGHT,23,2,"Mouse cursor position
  11526.                         (X,Y) = 39,12");
  11527.              WaitTime(200);
  11528.              SetMousePos(78,23);
  11529.              WriteScreen(WHITE_BLACK+HIGHLIGHT,23,2,"Mouse cursor position
  11530.                         (X,Y) = 78,23");
  11531.              WaitTime(200);
  11532.              }
  11533.           else
  11534.              WriteScreen(WHITE_BLACK+HIGHLIGHT,23,2,"No mouse installed.");
  11535.           }
  11536.  
  11537.  
  11538.  
  11539.  
  11540.  
  11541.  
  11542.                                      Page -191-
  11543.  
  11544.  
  11545.  
  11546.  
  11547.  
  11548.                           SCL1 Version 2.0 Reference Manual
  11549.  
  11550.  
  11551.                                                              SetShadowColor
  11552.  
  11553.           Function:    SetShadowColor
  11554.  
  11555.           Purpose:     Sets the shadow color for subsequent shadow effects
  11556.                        drawn.  When calling functions that support a shadow
  11557.                        effect, this function will permit you to select the
  11558.                        color to be XOR'ed with the background color to
  11559.                        produce a pleasing effect.  You must specify the
  11560.                        color in these functions as "0".  If you prefer a
  11561.                        solid color for the shadow effect you should specify
  11562.                        it as a color parameter when calling the function.
  11563.  
  11564.           Declaration: void SetShadowColor(int Color);
  11565.  
  11566.           Returns:     Nothing
  11567.  
  11568.           Parameters:
  11569.  
  11570.                  Color - color attribute for the shadow effect (to be
  11571.                          XOR'ed with the background color) (integer).
  11572.  
  11573.           Example:
  11574.  
  11575.           #include <scl1.h>
  11576.           #include <scl1clor.h>
  11577.  
  11578.           main()
  11579.           {
  11580.           FillBlock(WHITE_BLACK+HIGHLIGHT,0,0,24,79,'X');
  11581.           GSSBox(WHITE_BLACK+HIGHLIGHT,0,5,20,20,60,1,0,0);
  11582.           SetShadowColor(BLACK_WHITE);
  11583.           Shadow(0,5,20,20,60);
  11584.           GetKey();
  11585.           SetShadowColor(WHITE_BLACK);
  11586.           Shadow(0,5,20,20,60);
  11587.           GetKey();
  11588.           SetShadowColor(BLACK_BLACK+HIGHLIGHT);
  11589.           Shadow(0,5,20,20,60);
  11590.           }
  11591.  
  11592.  
  11593.  
  11594.  
  11595.  
  11596.  
  11597.  
  11598.  
  11599.  
  11600.  
  11601.                                      Page -192-
  11602.  
  11603.  
  11604.  
  11605.  
  11606.  
  11607.                           SCL1 Version 2.0 Reference Manual
  11608.  
  11609.  
  11610.                                                                  SetUserBox
  11611.  
  11612.           Function:    SetUserBox
  11613.  
  11614.           Purpose:     Lets you define a different frame type than those
  11615.                        available for the Box and GSSBox functions.
  11616.  
  11617.           Declaration: void SetUserBox(int UpperLeft,int UpperRight,
  11618.                             int LowerLeft,int LowerRight,int UpperSide,
  11619.                             int BottomSide,int LeftSide,int RightSide);
  11620.  
  11621.           Returns:     Nothing
  11622.  
  11623.           Parameters:
  11624.  
  11625.              UpperLeft - upper left corner character of the box frame
  11626.                          (integer).
  11627.  
  11628.             UpperRight - upper right corner character of the box frame
  11629.                          (integer).
  11630.  
  11631.              LowerLeft - lower left corner character of the box frame
  11632.                          (integer).
  11633.  
  11634.             LowerRight - lower right corner character of the box frame
  11635.                          (integer).
  11636.  
  11637.              UpperSide - characters to be used for drawing the upper border
  11638.                          of the box frame (integer).
  11639.  
  11640.             BottomSide - characters to be used for drawing the bottom
  11641.                          border of the box frame (integer).
  11642.  
  11643.               LeftSide - characters to be used for drawing the left border
  11644.                          of the box frame (integer).
  11645.  
  11646.              RightSide - characters to be used for drawing the right border
  11647.                          of the box frame (integer).
  11648.  
  11649.  
  11650.  
  11651.  
  11652.  
  11653.  
  11654.  
  11655.  
  11656.  
  11657.  
  11658.  
  11659.  
  11660.                                      Page -193-
  11661.  
  11662.  
  11663.  
  11664.  
  11665.  
  11666.                           SCL1 Version 2.0 Reference Manual
  11667.  
  11668.  
  11669.                                                                  SetUserBox
  11670.  
  11671.           Example:
  11672.  
  11673.           #include <scl1.h>
  11674.           #include <scl1clor.h>
  11675.  
  11676.           main()
  11677.           {
  11678.           SetUserBox(21,21,21,21,21,21,21,21);
  11679.           GSSBox(BLACK_WHITE,12,2,2,22,77,1,0,0);
  11680.           }
  11681.  
  11682.  
  11683.  
  11684.  
  11685.  
  11686.  
  11687.  
  11688.  
  11689.  
  11690.  
  11691.  
  11692.  
  11693.  
  11694.  
  11695.  
  11696.  
  11697.  
  11698.  
  11699.  
  11700.  
  11701.  
  11702.  
  11703.  
  11704.  
  11705.  
  11706.  
  11707.  
  11708.  
  11709.  
  11710.  
  11711.  
  11712.  
  11713.  
  11714.  
  11715.  
  11716.  
  11717.  
  11718.  
  11719.                                      Page -194-
  11720.  
  11721.  
  11722.  
  11723.  
  11724.  
  11725.                           SCL1 Version 2.0 Reference Manual
  11726.  
  11727.  
  11728.                                                              SetUserBoxLine
  11729.  
  11730.           Function:    SetUserBoxLine
  11731.  
  11732.           Purpose:     Lets you define a line type for drawing lines inside
  11733.                        boxes that use lines defined by using the SetUserBox
  11734.                        function.
  11735.  
  11736.           Declaration: void SetUserBoxLine(int HLeft,int HRight,
  11737.                             int VUpper,int VLower);
  11738.  
  11739.           Returns:     Nothing
  11740.  
  11741.           Parameters:
  11742.  
  11743.                  HLeft - horizontal left terminating character of the line
  11744.                          (integer).
  11745.  
  11746.                 HRight - horizontal right terminating character of the line
  11747.                          (integer).
  11748.  
  11749.                 VUpper - vertical upper terminating character of the line
  11750.                          (integer).
  11751.  
  11752.                 VLower - vertical lower terminating character of the line
  11753.                          (integer).
  11754.  
  11755.           Example:
  11756.  
  11757.           #include (scl1.h>
  11758.  
  11759.           main()
  11760.              {
  11761.              SetUserBoxLine(201,188,200,189,205,205,186,186);
  11762.              .
  11763.              .
  11764.              /* Will set a user type frame to double line, exactly as
  11765.               defined in standard frame type 0 of the Box and GSSBox
  11766.               functions*/
  11767.              }
  11768.  
  11769.  
  11770.  
  11771.  
  11772.  
  11773.  
  11774.  
  11775.  
  11776.  
  11777.  
  11778.                                      Page -195-
  11779.  
  11780.  
  11781.  
  11782.  
  11783.  
  11784.                           SCL1 Version 2.0 Reference Manual
  11785.  
  11786.  
  11787.                                                                 SetVerLimit
  11788.  
  11789.           Function:    SetVerLimit
  11790.  
  11791.           Purpose:     Sets the mouse minimum and maximum vertical
  11792.                        coordinates.
  11793.  
  11794.           Declaration: void SetVerLimit(int Minimum,int Maximum);
  11795.  
  11796.           Returns:     Nothing
  11797.  
  11798.           Parameters:
  11799.  
  11800.                Minimum - integer value indicating the minimum vertical
  11801.                          coordinate.
  11802.  
  11803.                Maximum - integer value indicating the maximum vertical
  11804.                          coordinate.
  11805.           Example:
  11806.  
  11807.           #include <scl1.h>
  11808.           #include <scl1clor.h>
  11809.  
  11810.           main()
  11811.           {
  11812.           InitMouse(IM_SHOW);
  11813.           if(MSE_MouseFl)
  11814.              {
  11815.              SetVerLimit(11,11);
  11816.              printf("Mouse movement has been limited to line 11, click
  11817.                     mouse to exit\n");
  11818.              while(!MSE_LPress);
  11819.              }
  11820.           else
  11821.              printf("No mouse installed\n");
  11822.           }
  11823.  
  11824.           See also SetHorLimit.
  11825.  
  11826.  
  11827.  
  11828.  
  11829.  
  11830.  
  11831.  
  11832.  
  11833.  
  11834.  
  11835.  
  11836.  
  11837.                                      Page -196-
  11838.  
  11839.  
  11840.  
  11841.  
  11842.  
  11843.                           SCL1 Version 2.0 Reference Manual
  11844.  
  11845.  
  11846.                                                                SetVideoMode
  11847.  
  11848.           Function:    SetVideoMode
  11849.  
  11850.           Purpose:     Sets the desired video mode.  See the BIOS reference
  11851.                        manual for the available video modes. SCL1 only
  11852.                        supports the 40 and 80 column text modes.
  11853.  
  11854.           Declaration: void SetVideoMode(int NewMode);
  11855.  
  11856.           Returns:     Nothing
  11857.  
  11858.           Parameters:
  11859.  
  11860.                NewMode - video mode as defined by the DOS (integer).
  11861.  
  11862.           Example:
  11863.  
  11864.           #include <scl1.h>
  11865.  
  11866.           /* Initializes Video mode to mode 3 in case of color, EGA or VGA
  11867.              or to mode 7 in case mono */
  11868.  
  11869.           void InitVideo(void)
  11870.           {
  11871.  
  11872.           Video();
  11873.           if(VC_Segment==COLOR)
  11874.              SetVideoMode(3);
  11875.           else
  11876.              SetVideoMode(7);
  11877.           }
  11878.  
  11879.  
  11880.  
  11881.  
  11882.  
  11883.  
  11884.  
  11885.  
  11886.  
  11887.  
  11888.  
  11889.  
  11890.  
  11891.  
  11892.  
  11893.  
  11894.  
  11895.  
  11896.                                      Page -197-
  11897.  
  11898.  
  11899.  
  11900.  
  11901.  
  11902.                           SCL1 Version 2.0 Reference Manual
  11903.  
  11904.  
  11905.                                                                SetVideoPage
  11906.  
  11907.           Function:    SetVideoPage
  11908.  
  11909.           Purpose:     Sets the active video page.  See the BIOS reference
  11910.                        manual for the available video pages.
  11911.  
  11912.           Declaration: void SetVideoPage(int NewPage);
  11913.  
  11914.           Returns:     Nothing
  11915.  
  11916.           Parameters:
  11917.  
  11918.                NewPage - video page (supported by your display adapter) as
  11919.                          defined in the BIOS (integer).
  11920.  
  11921.           Example:
  11922.  
  11923.           #include <scl1.h>
  11924.           #include <scl1clor.h>
  11925.  
  11926.           main()
  11927.           {
  11928.           Video();
  11929.           if(VC_Monitor==VC_MDA)
  11930.              {
  11931.              printf("Monochrome monitors do not support video pages\n");
  11932.              exit(-1);
  11933.              }
  11934.           Cls(WHITE_BLACK,CLS_ALL);
  11935.           WriteScreen(WHITE_BLACK,10,35,"Video page 0");
  11936.           WaitTime(100);
  11937.           SetVideoPage(1);
  11938.           Cls(BLACK_WHITE,CLS_ALL);
  11939.           WriteScreen(BLACK_WHITE,10,35,"Video page 1");
  11940.           WaitTime(100);
  11941.           SetVideoPage(0);
  11942.           WaitTime(100);
  11943.           SetVideoPage(1);
  11944.           WaitTime(100);
  11945.           SetVideoPage(0);
  11946.           }
  11947.  
  11948.  
  11949.  
  11950.  
  11951.  
  11952.  
  11953.  
  11954.  
  11955.                                      Page -198-
  11956.  
  11957.  
  11958.  
  11959.  
  11960.  
  11961.                           SCL1 Version 2.0 Reference Manual
  11962.  
  11963.  
  11964.                                                                SetVideo4350
  11965.                                                                  Setvideo25
  11966.  
  11967.           Function:    SetVideo4350
  11968.                        SetVideo25
  11969.  
  11970.           Purpose:     The SetVideo4350 function sets the display mode to
  11971.                        43 lines (EGA display adapters) or to the 50 lines
  11972.                        (VGA display adapters).  The SetVideo25 function
  11973.                        resets the display mode to 25 lines.
  11974.  
  11975.           Declaration: void SetVideo4350(void);
  11976.                        void SetVideo25();
  11977.  
  11978.           Returns:     Nothing
  11979.  
  11980.           Parameters:  None
  11981.  
  11982.           Example:
  11983.  
  11984.           #include <scl1.h>
  11985.           #include <scl1clor.h>
  11986.  
  11987.           main()
  11988.           {
  11989.           Video();
  11990.           if(VC_Monitor != VC_VGA && VC_Monitor != VC_EGA)
  11991.              {
  11992.              printf("Video system does not supports 43/50 lines video
  11993.                     mode\n");
  11994.              exit(-1);
  11995.              }
  11996.           SetVideo4350();
  11997.           FillBlock(WHITE_BLACK,0,0,VC_Lines-1,79,'*');
  11998.           MessageOn(BLACK_WHITE,"43/50 lines Video Mode\n
  11999.                    press any key...");
  12000.           GetKey();
  12001.  
  12002.           SetVideo25();
  12003.           FillBlock(WHITE_BLACK,0,0,VC_Lines-1,79,'*');
  12004.           MessageOn(BLACK_WHITE,"25 lines Video Mode\npress any key...");
  12005.           GetKey();
  12006.  
  12007.           Cls(7,CLS_ALL);
  12008.           }
  12009.  
  12010.  
  12011.  
  12012.  
  12013.  
  12014.                                      Page -199-
  12015.  
  12016.  
  12017.  
  12018.  
  12019.  
  12020.                           SCL1 Version 2.0 Reference Manual
  12021.  
  12022.  
  12023.                                                                      Shadow
  12024.  
  12025.           Function:    Shadow
  12026.  
  12027.           Purpose:     Draws a shadow to a screen area.
  12028.  
  12029.           Declaration: void Shadow(int Color,int UpperRow, int LeftCol,
  12030.                             int LowerRow, int RightCol);
  12031.  
  12032.           Returns:     Nothing
  12033.  
  12034.           Parameters:
  12035.  
  12036.                  Color - color attribute of the desired shadow effect. If a
  12037.                          value of "0" is specified the shadow effect is
  12038.                          XOR'ed. to the screen area.  You can use the
  12039.                          SetShadowColor function to specify the color to be
  12040.                          XOR'ed with the foreground (integer).
  12041.  
  12042.               UpperRow - upper row coordinate of the area (integer).
  12043.  
  12044.                LeftCol - left column coordinate of the area (integer).
  12045.  
  12046.               LowerRow - lower row coordinate of the area (integer).
  12047.  
  12048.               RightCol - right column coordinate of the area (integer).
  12049.  
  12050.           Example:
  12051.  
  12052.           #include <scl1.h>
  12053.           #include <scl1clor.h>
  12054.  
  12055.           main()
  12056.           {
  12057.           Box(WHITE_BLACK,0,10,10,20,70);
  12058.           Shadow(BLACK_WHITE,10,10,20,70);
  12059.           }
  12060.  
  12061.  
  12062.  
  12063.  
  12064.  
  12065.  
  12066.  
  12067.  
  12068.  
  12069.  
  12070.  
  12071.  
  12072.  
  12073.                                      Page -200-
  12074.  
  12075.  
  12076.  
  12077.  
  12078.  
  12079.                           SCL1 Version 2.0 Reference Manual
  12080.  
  12081.  
  12082.                                                                   ShowMouse
  12083.  
  12084.           Function:    ShowMouse
  12085.  
  12086.           Purpose:     Makes mouse cursor visible.
  12087.  
  12088.           Declaration: void ShowMouse(void);
  12089.  
  12090.           Returns:     Nothing
  12091.  
  12092.           Parameters:  None
  12093.  
  12094.           Example:
  12095.  
  12096.           #include <scl1.h>
  12097.  
  12098.           main()
  12099.              {
  12100.              InitMouse(IM_SHOW); /* initialize mouse, turn cursor on */
  12101.  
  12102.              if(MSE_MouseFl)
  12103.                 {
  12104.                 printf("We have a mouse, click the left button to turn
  12105.                         mouse cursor off.\n");
  12106.                 WaitKeyMouse();
  12107.                 HideMouse();
  12108.                 printf("Click again to turn mouse cursor on.\n");
  12109.                 WaitKeyMouse();
  12110.                 ShowMouse();
  12111.                 printf("Click to exit.\n");
  12112.                 WaitKeyMouse();
  12113.                 }
  12114.              else
  12115.                 printf("We don't have a mouse\n");
  12116.              }
  12117.  
  12118.  
  12119.  
  12120.  
  12121.  
  12122.  
  12123.  
  12124.  
  12125.  
  12126.  
  12127.  
  12128.  
  12129.  
  12130.  
  12131.  
  12132.                                      Page -201-
  12133.  
  12134.  
  12135.  
  12136.  
  12137.  
  12138.                           SCL1 Version 2.0 Reference Manual
  12139.  
  12140.  
  12141.                                                                SortPointers
  12142.  
  12143.           Function:    SortPointers
  12144.  
  12145.           Purpose:     Sorts a null terminated array of char pointers that
  12146.                        hold the address of strings according in
  12147.                        alphabetical order.
  12148.  
  12149.           Declaration: void SortPointers(char *p[]);
  12150.  
  12151.           Returns:     Nothing
  12152.  
  12153.           Parameters:
  12154.  
  12155.                    p - pointer to a null terminated array of char pointers.
  12156.  
  12157.           Example:
  12158.  
  12159.           #include <scl1.h>
  12160.  
  12161.           char *names[]={
  12162.              "Mozart",
  12163.              "Villa-Lobos",
  12164.              "Chopin",
  12165.              "Bach",
  12166.              "Schubert",
  12167.              "Debussy",
  12168.              "Albeniz",
  12169.              "Beethoven",
  12170.              "Falla",
  12171.              0,
  12172.              };
  12173.  
  12174.           main()
  12175.           {
  12176.           int i;
  12177.  
  12178.           SortPointers(names);
  12179.           for(i=0;names[i];++i)
  12180.              printf("%s\n",names[i]);
  12181.           }
  12182.  
  12183.  
  12184.  
  12185.  
  12186.  
  12187.  
  12188.  
  12189.  
  12190.  
  12191.                                      Page -202-
  12192.  
  12193.  
  12194.  
  12195.  
  12196.  
  12197.                           SCL1 Version 2.0 Reference Manual
  12198.  
  12199.  
  12200.                                                                       Sound
  12201.  
  12202.           Function:    Sound
  12203.  
  12204.           Purpose:     Sets a sound frequency.
  12205.  
  12206.           Declaration: void Sound(int Freq);
  12207.  
  12208.           Returns:     Nothing
  12209.  
  12210.           Parameters:
  12211.  
  12212.                 Freq - the desired frequency in hertz (integer).
  12213.  
  12214.           Example:
  12215.  
  12216.           #include <scl1.h>
  12217.  
  12218.           main()
  12219.              {
  12220.              SoundOn();
  12221.              for(Freq=400;Freq<2000;Freq+=100)
  12222.                 {
  12223.                 Sound(Freq);
  12224.                 WaitTime(10);
  12225.                 }
  12226.              SoundOff();
  12227.              }
  12228.  
  12229.           See the note definitions in header file SCL1SND.H.
  12230.  
  12231.  
  12232.  
  12233.  
  12234.  
  12235.  
  12236.  
  12237.  
  12238.  
  12239.  
  12240.  
  12241.  
  12242.  
  12243.  
  12244.  
  12245.  
  12246.  
  12247.  
  12248.  
  12249.  
  12250.                                      Page -203-
  12251.  
  12252.  
  12253.  
  12254.  
  12255.  
  12256.                           SCL1 Version 2.0 Reference Manual
  12257.  
  12258.  
  12259.                                                                    SoundOff
  12260.                                                                     SoundOn
  12261.  
  12262.           Function:    SoundOff
  12263.                        SoundOn
  12264.  
  12265.  
  12266.           Purpose:     Turns the speaker Off or On.
  12267.  
  12268.  
  12269.           Declaration: void SoundOff(void);
  12270.                        void SoundOn(void);
  12271.  
  12272.           Returns:     Nothing
  12273.  
  12274.           Parameters:  None
  12275.  
  12276.           Example:
  12277.  
  12278.           #include <scl1.h>
  12279.  
  12280.           main()
  12281.              {
  12282.              SoundOn();
  12283.              for(Freq=400;Freq<2000;Freq+=100)
  12284.                 {
  12285.                 Sound(Freq);
  12286.                 WaitTime(10);
  12287.                 }
  12288.              SoundOff();
  12289.              }
  12290.  
  12291.           See the note definitions in header file SCL1SND.H.
  12292.  
  12293.  
  12294.  
  12295.  
  12296.  
  12297.  
  12298.  
  12299.  
  12300.  
  12301.  
  12302.  
  12303.  
  12304.  
  12305.  
  12306.  
  12307.  
  12308.  
  12309.                                      Page -204-
  12310.  
  12311.  
  12312.  
  12313.  
  12314.  
  12315.                           SCL1 Version 2.0 Reference Manual
  12316.  
  12317.  
  12318.                                                                   StopWatch
  12319.  
  12320.           Function:    StopWatch
  12321.  
  12322.           Purpose:     Measures elapsed time in 1/100 seconds
  12323.  
  12324.           Declaration: long StopWatch(int Function);
  12325.  
  12326.           Returns:     Elapsed Time between calls to the function.  The
  12327.                        stop watch is started by calling the function with
  12328.                        the SW_START parameter.  When the stop watch is
  12329.                        stopped by calling the function with the SW_STOP
  12330.                        parameter it returns the elapsed time.
  12331.  
  12332.           Parameters:
  12333.  
  12334.                    See the above explanation.
  12335.  
  12336.           Example:
  12337.  
  12338.           #include <scl1.h>
  12339.  
  12340.           main()
  12341.           {
  12342.           unsigned int i;
  12343.           register unsigned int j;
  12344.           long t;
  12345.  
  12346.           StopWatch(SW_START);
  12347.           for(i=0;i < 65535;++i);
  12348.           t=StopWatch(SW_STOP);
  12349.           printf("Your computer needs %li/100 of a second to count from
  12350.                     1 to 65535.\n",t);
  12351.  
  12352.           StopWatch(SW_START);
  12353.           for(j=0;j < 65535;++j);
  12354.           t=StopWatch(SW_STOP);
  12355.           printf("This time can be reduced to %li/100 of a second by using
  12356.                    a register variable.\n",t);
  12357.           }
  12358.  
  12359.  
  12360.  
  12361.  
  12362.  
  12363.  
  12364.  
  12365.  
  12366.  
  12367.  
  12368.                                      Page -205-
  12369.  
  12370.  
  12371.  
  12372.  
  12373.  
  12374.                           SCL1 Version 2.0 Reference Manual
  12375.  
  12376.  
  12377.                                                                     TagItem
  12378.  
  12379.           Function:    TagItem
  12380.  
  12381.           Purpose:     Will permit the display of one item and permits the
  12382.                        user to tag or untag it.  To tag or untag an item,
  12383.                        move the cursor to the tag indicator (a pair of
  12384.                        parenthesis) and press the SPACEBAR.  An item can
  12385.                        also be tagged or untagged by clicking the left
  12386.                        mouse button after pointing it.  An item that has
  12387.                        been tagged will be displayed with a check mark (√)
  12388.                        between the tag indicating parenthesis.  This is a
  12389.                        dialog type function that can either be used alone
  12390.                        or as one of the field types for the fields option.
  12391.  
  12392.           Declaration: int TagItem(int Message, TIData *tg)
  12393.  
  12394.           Returns:     This is a dialog type function. See Appendix "E" for
  12395.                        a description of the general operation of these
  12396.                        functions.  The return value is a message described
  12397.                        in the Messages section.
  12398.  
  12399.           Parameters:
  12400.  
  12401.           The TagItem parameters must be passed to a structure of the type
  12402.           SData1 as follows.
  12403.  
  12404.           Structure type TIData.
  12405.  
  12406.           typedef struct{
  12407.              int Color;
  12408.              int Row;
  12409.              int Col;
  12410.              int TagFl;
  12411.              char *String;
  12412.              unsigned int *ExitKeys;
  12413.              unsigned int EventInfo;
  12414.              }TIData;
  12415.  
  12416.           where,
  12417.  
  12418.                  Color - color attributes for the display of the TagItem
  12419.                          (integer).
  12420.  
  12421.                    Row - row position where the TagItem is displayed
  12422.                          (integer).
  12423.  
  12424.                    Col - column position where the TagItem is displayed
  12425.                          (integer).
  12426.  
  12427.                                      Page -206-
  12428.  
  12429.  
  12430.  
  12431.  
  12432.  
  12433.                           SCL1 Version 2.0 Reference Manual
  12434.  
  12435.  
  12436.                                                                     TagItem
  12437.  
  12438.                 String - char pointer to the text used to identify the
  12439.                          TagItem.
  12440.  
  12441.                  TagFl - a flag that will have a value of "1" if the item
  12442.                          has been tagged and a value of "0" if it has not
  12443.                          been tagged (integer).
  12444.  
  12445.               ExitKeys - array of keys defined as exit keys (unsigned
  12446.                          integer).
  12447.  
  12448.              EventInfo - this structure element will hold the last key
  12449.                          pressed (unsigned integer).
  12450.  
  12451.           Messages:
  12452.  
  12453.           The following messages can be sent to Select:
  12454.  
  12455.                          TI_INIT -   initialize the TIData structure to
  12456.                                      NULL and set the following default
  12457.                                      values:
  12458.  
  12459.                              Color - set to white characters in a black
  12460.                                      background or the normal color defined
  12461.                                      by calling SetDialogColors.
  12462.  
  12463.                         TI_DRAW - display the Tag Item with the current
  12464.                                   information.
  12465.  
  12466.                       TI_ACTIVE - take control to tag an item.
  12467.  
  12468.                  TI_CHECK_MOUSE - check if the mouse has been clicked after
  12469.                                   pointing to the area defined by the
  12470.                                   function.
  12471.  
  12472.                        TI_RESET - when this message is sent the position
  12473.                                   variables are reset to the default value. 
  12474.                                   If the exit keys have not been defined
  12475.                                   they are set to the default exit keys.
  12476.  
  12477.           The following messages can be returned by TagItem:
  12478.  
  12479.                           TI_OK - the requested action has been performed.
  12480.  
  12481.                     TI_EXIT_KEY - a defined exit key has been pressed.
  12482.  
  12483.  
  12484.  
  12485.  
  12486.                                      Page -207-
  12487.  
  12488.  
  12489.  
  12490.  
  12491.  
  12492.                           SCL1 Version 2.0 Reference Manual
  12493.  
  12494.  
  12495.                                                                     TagItem
  12496.  
  12497.                  TI_MOUSE_EVENT - the mouse has been clicked but it has not
  12498.                                   been pointed to the area defined by the
  12499.                                   function.
  12500.  
  12501.                  TI_ILLEGAL_KEY - an undefined key has been pressed.
  12502.  
  12503.                     TI_MY_MOUSE - the mouse has been clicked after pointing
  12504.                                   to the area defined by the function. This
  12505.                                   message is in response to a
  12506.                                   TI_CHECK_MOUSE message.
  12507.  
  12508.           Example:
  12509.  
  12510.           #include <scl1.h>
  12511.           #include <scl1keys.h>
  12512.           #include <scl1clor.h>
  12513.  
  12514.           TIData ti={WHITE_BLACK,12,28,0,"Create Backup files",0,0};
  12515.  
  12516.           main()
  12517.           {
  12518.           int Mess;
  12519.  
  12520.           Cls(WHITE_BLACK,0,0,24,79);
  12521.           TagItem(TI_RESET,&ti);
  12522.           TagItem(TI_DRAW,&ti);
  12523.           do
  12524.              {
  12525.              Mess=TagItem(TI_ACTIVE,&ti);
  12526.              }while(Mess != TI_EXIT_KEY);
  12527.           }
  12528.  
  12529.  
  12530.  
  12531.  
  12532.  
  12533.  
  12534.  
  12535.  
  12536.  
  12537.  
  12538.  
  12539.  
  12540.  
  12541.  
  12542.  
  12543.  
  12544.  
  12545.                                      Page -208-
  12546.  
  12547.  
  12548.  
  12549.  
  12550.  
  12551.                           SCL1 Version 2.0 Reference Manual
  12552.  
  12553.  
  12554.                                                                     TagList
  12555.  
  12556.           Function:    TagList
  12557.  
  12558.           Purpose:     Displays in a ScrollBox any number of items that the
  12559.                        user can tag using the keyboard (spacebar) or the
  12560.                        mouse.
  12561.  
  12562.           Declaration: int TagList(int NColor, int RColor,struct
  12563.                            TagList *tl);
  12564.  
  12565.           Returns:     Return value is a number above "0" if the user
  12566.                        pressed ENTER to exit, otherwise returns "-1".  In
  12567.                        case the user has pressed ESCAPE to exit the tagged
  12568.                        items are returned in the same way as they were
  12569.                        received.
  12570.  
  12571.           Parameters:
  12572.  
  12573.           The taglist information must be given as an array of structures
  12574.           as follows:
  12575.  
  12576.              struct TagList{
  12577.                 char TagFl;
  12578.                 char *String;
  12579.                 };
  12580.  
  12581.           where,
  12582.  
  12583.                  TagFl - equals "1" if item is tagged (char).
  12584.  
  12585.                 String - a pointer to the item string (char).
  12586.  
  12587.           Note: The TagList structure must be zero terminated.
  12588.  
  12589.           The function is called with the following parameters:
  12590.  
  12591.                 NColor - color used for box and items (integer).
  12592.  
  12593.                 RColor - color used for selected item (integer).
  12594.  
  12595.                     tl - pointer to structure TagList. This structure is
  12596.                          defined in SCL1.H:
  12597.  
  12598.  
  12599.  
  12600.  
  12601.  
  12602.  
  12603.  
  12604.                                      Page -209-
  12605.  
  12606.  
  12607.  
  12608.  
  12609.  
  12610.                           SCL1 Version 2.0 Reference Manual
  12611.  
  12612.  
  12613.                                                                     TagList
  12614.  
  12615.           Example:
  12616.  
  12617.           #include <scl1.h>
  12618.           #include <scl1clor.h>
  12619.  
  12620.           struct TagList tl[]={
  12621.              0,"Option 1",
  12622.              0,"Option 2",
  12623.              0,"Option 3",
  12624.              0,"Option 4",
  12625.              0,"Option 5",
  12626.              0,"Option 6",
  12627.              0,"Option 7",
  12628.              0,"Option 8",
  12629.              0,"Option 9",
  12630.              0};
  12631.  
  12632.           main()
  12633.           {
  12634.           int i;
  12635.  
  12636.           if(TagList(WHITE_BLACK,BLACK_WHITE,tl) != -1) 
  12637.                 /* cancel selected?  */
  12638.              {
  12639.              printf("\nThe following options were tagged:\n");
  12640.              for(i=0;i < 9;++i)
  12641.                 {
  12642.                 if(tl[i].TagFl)
  12643.                    printf("%s\n",tl[i].String);
  12644.                 }
  12645.              }
  12646.           else
  12647.              printf("\nOperation canceled by user\n");
  12648.           }
  12649.  
  12650.           NOTE: The new dialog type function TagList2 provides an
  12651.                 alternative way to accomplish this task.
  12652.  
  12653.  
  12654.  
  12655.  
  12656.  
  12657.  
  12658.  
  12659.  
  12660.  
  12661.  
  12662.  
  12663.                                      Page -210-
  12664.  
  12665.  
  12666.  
  12667.  
  12668.  
  12669.                           SCL1 Version 2.0 Reference Manual
  12670.  
  12671.  
  12672.                                                                    Taglist2
  12673.  
  12674.           Function:    TagList2
  12675.  
  12676.           Purpose:     Displays a list of items and permits tagging and
  12677.                        untagging of selected items.  The list will scroll
  12678.                        vertically when the number of items is larger than
  12679.                        the display length using the cursor keys or the
  12680.                        mouse. Pressing the SPACEBAR key or clicking the
  12681.                        mouse in a highlighted item tags the desired item.
  12682.  
  12683.           Declaration: int Taglist2(int Message,TLData *p,...)
  12684.  
  12685.           Returns:     This is a dialog derived function. See Appendix "E"
  12686.                        for a description of the general operation  of these
  12687.                        functions.  The return value is a message described
  12688.                        in the Messages section.
  12689.  
  12690.           Parameters:
  12691.  
  12692.           The Tag List information must be given in a structure defined as
  12693.           type TLData. The structure elements are as follows:
  12694.  
  12695.           typedef struct{
  12696.              int NColor;
  12697.              int RColor;
  12698.              int TColor;
  12699.              int UpperRow;
  12700.              int LeftCol;
  12701.              int LowerRow;
  12702.              int RightCol;
  12703.              char **Array;
  12704.              char *TagArray;
  12705.              }TLData;
  12706.  
  12707.           where,
  12708.  
  12709.                 NColor - color attribute for normal display (integer).
  12710.  
  12711.                 RColor - color attributes for reversed display (integer).
  12712.  
  12713.                 TColor - color attributes to be used for displaying a
  12714.                          tagged item (integer).
  12715.  
  12716.               UpperRow - upper row coordinate of the window (integer).
  12717.  
  12718.                LeftCol - left column coordinate of the window (integer).
  12719.  
  12720.  
  12721.  
  12722.                                      Page -211-
  12723.  
  12724.  
  12725.  
  12726.  
  12727.  
  12728.                           SCL1 Version 2.0 Reference Manual
  12729.  
  12730.  
  12731.                                                                    Taglist2
  12732.  
  12733.               LowerRow - lower row coordinate of the window (integer).
  12734.  
  12735.               RightCol - right column coordinate of the window (integer).
  12736.  
  12737.                  Array - pointer to array of pointers to be displayed.
  12738.  
  12739.               TagArray - a char pointer to an array that hold the tagging
  12740.                          information about each item.
  12741.  
  12742.           The messages that can be sent to the TagList2 function are:
  12743.  
  12744.                         TL_INIT - initialize the TLData structure as
  12745.                                   follows:
  12746.  
  12747.                             NColor - set to white characters in a black
  12748.                                      background or the normal color defined
  12749.                                      by calling SetDialogColors.
  12750.  
  12751.                             RColor - set to highlighted white characters in
  12752.                                      a black background or the normal color
  12753.                                      defined by calling SetDialogColors.
  12754.  
  12755.                             TColor - set to black characters in a white
  12756.                                      background or the reversed color
  12757.                                      defined by calling SetDialogColors.
  12758.  
  12759.                           UpperRow - set to row "6".
  12760.  
  12761.                            LeftCol - set to column "5" for 40 column
  12762.                                      display and "34" for 80 column
  12763.                                      display.
  12764.  
  12765.                           LowerRow - set to row "17" for 24 row display and
  12766.                                      "29" for 43 row display.
  12767.  
  12768.                           RightCol - set to row "34" for 40 column display
  12769.                                      and "55" for 80 column display.
  12770.  
  12771.                         TL_DRAW - display the Tag List with the current
  12772.                                   information.
  12773.  
  12774.  
  12775.  
  12776.  
  12777.  
  12778.  
  12779.  
  12780.  
  12781.                                      Page -212-
  12782.  
  12783.  
  12784.  
  12785.  
  12786.  
  12787.                           SCL1 Version 2.0 Reference Manual
  12788.  
  12789.  
  12790.                                                                    Taglist2
  12791.  
  12792.                       TL_ACTIVE - browse through the displayed items and
  12793.                                   permit the selection or tagging of them
  12794.                                   using the cursor movement keys as
  12795.                                   follows:
  12796.  
  12797.                          Key                      action
  12798.  
  12799.                        Up Arrow         cursor one item up.
  12800.                        Down Arrow       cursor one item down.
  12801.                        END              cursor to end of file list.
  12802.                        HOME             cursor to beginning of list.
  12803.                        Page Up          cursor one screen up.
  12804.                        Page Down        cursor one screen down.
  12805.                        SpaceBar         Tag or Untag an item
  12806.  
  12807.           The messages that TagList2 can return are:
  12808.  
  12809.                        TL_OK - the requested action has been performed.
  12810.  
  12811.                    TL_CANCEL - cancel the TagList2 operation.
  12812.  
  12813.           Example:
  12814.  
  12815.           #include <scl1.h>
  12816.  
  12817.           char *options[]={
  12818.              "Option 1",
  12819.              "Option 2",
  12820.              "Option 3",
  12821.              "Option 4",
  12822.              "Option 5",
  12823.              "Option 6",
  12824.              "Option 7",
  12825.              0};
  12826.  
  12827.           char tarray[7];
  12828.  
  12829.           main()
  12830.           {
  12831.           TLData tl;
  12832.           int i,Mess;
  12833.  
  12834.  
  12835.  
  12836.  
  12837.  
  12838.  
  12839.  
  12840.                                      Page -213-
  12841.  
  12842.  
  12843.  
  12844.  
  12845.  
  12846.                           SCL1 Version 2.0 Reference Manual
  12847.  
  12848.  
  12849.                                                                    Taglist2
  12850.  
  12851.           TagList2(TL_INIT,&tl);        /* initialize structure */
  12852.           tl.UpperRow=6;                /* modify position */
  12853.           tl.LowerRow=15;
  12854.           tl.LeftCol=20;
  12855.           tl.RightCol=60;
  12856.           tl.Array=options;             /*initialize TagList2 to our data*/
  12857.           tl.TagArray=tarray;
  12858.           TagList2(TL_DRAW,&tl);        /* draw */
  12859.           Mess=TagList2(TL_ACTIVE,&tl); /* active */
  12860.           if(Mess==TL_OK)
  12861.              {
  12862.              printf("\nThe following options were tagged:\n");
  12863.              for(i=0;i < 7;++i)
  12864.                 {
  12865.                 if(tarray[i])
  12866.                 printf("%s\n",options[i]);
  12867.                 }
  12868.              }
  12869.           else
  12870.              printf("\nOperation canceled by user\n");
  12871.           }
  12872.  
  12873.  
  12874.  
  12875.  
  12876.  
  12877.  
  12878.  
  12879.  
  12880.  
  12881.  
  12882.  
  12883.  
  12884.  
  12885.  
  12886.  
  12887.  
  12888.  
  12889.  
  12890.  
  12891.  
  12892.  
  12893.  
  12894.  
  12895.  
  12896.  
  12897.  
  12898.  
  12899.                                      Page -214-
  12900.  
  12901.  
  12902.  
  12903.  
  12904.  
  12905.                           SCL1 Version 2.0 Reference Manual
  12906.  
  12907.  
  12908.                                                                     TagMenu
  12909.  
  12910.           Function:    TagMenu
  12911.  
  12912.           Purpose:     Displays a menu from which you can tag any or all of
  12913.                        the available options.  An item is toggled on or off
  12914.                        by moving the highlighted bar with the arrow keys
  12915.                        and then pressing the  SPACEBAR or by clicking the
  12916.                        mouse.  The tagged options will be marked with a
  12917.                        check mark.  The menu items can be placed anywhere
  12918.                        in the screen and in any desired order, you are not
  12919.                        limited to placing all the menu options in
  12920.                        successive lines.  Upon exit you can either cancel
  12921.                        the operation or continue.
  12922.  
  12923.           Declaration: int TagMenu(char NormalColor, char ReverseColor,
  12924.                            char HighlightColor, char NumOpt,struct
  12925.                            MenuOpt*, int XMin,int XMax,int YMin,
  12926.                            int YMax);
  12927.  
  12928.           Returns:     The returned value is "0" if the user selects the
  12929.                        accept option and "-1" if the operation is
  12930.                        cancelled.  The calling program must check the first
  12931.                        character of each selection of the structure to find
  12932.                        out if a selection was tagged.
  12933.  
  12934.           Parameters:
  12935.  
  12936.           The menu information must be given as an array of structures as
  12937.           follows:
  12938.  
  12939.                 struct MenuOpt{
  12940.                    int Row,Col;
  12941.                    char *String;
  12942.                    int Letter;
  12943.                    };
  12944.  
  12945.           where:
  12946.  
  12947.                    Row - row position for the menu item (integer).
  12948.  
  12949.                    Col - column position for the menu item (integer).
  12950.  
  12951.                 String - pointer to the menu item text (char).
  12952.  
  12953.                 Letter - letter to be highlighted for fast keyboard
  12954.                          selection of the menu item (integer).
  12955.  
  12956.  
  12957.  
  12958.                                      Page -215-
  12959.  
  12960.  
  12961.  
  12962.  
  12963.  
  12964.                           SCL1 Version 2.0 Reference Manual
  12965.  
  12966.  
  12967.                                                                     TagMenu
  12968.  
  12969.           Note:    The last two options in the menu structure are the exit
  12970.                    control codes to the function.  First the option that
  12971.                    cancels the operation and then the option that accepts
  12972.                    the operation.
  12973.  
  12974.           The parameters passed to the function are:
  12975.  
  12976.                 NColor - color attribute of the menu background and
  12977.                          foreground (integer).
  12978.  
  12979.                 RColor - color attribute of the highlighted item menu bar
  12980.                          (integer).
  12981.  
  12982.                 HColor - color attribute for the highlighted quick
  12983.                          selection menu item letter (integer).
  12984.  
  12985.                 NumOpt - number of menu options (integer).
  12986.  
  12987.                MenuOpt - pointer to the menu structure (char).
  12988.  
  12989.                   XMin - minimum row position of menu area (integer).
  12990.  
  12991.                   XMax - maximum row position of menu area (integer).
  12992.  
  12993.                   YMin - minimum column position of menu area (integer).
  12994.  
  12995.                   YMax - maximum column position of menu area (integer).
  12996.  
  12997.  
  12998.  
  12999.  
  13000.  
  13001.  
  13002.  
  13003.  
  13004.  
  13005.  
  13006.  
  13007.  
  13008.  
  13009.  
  13010.  
  13011.  
  13012.  
  13013.  
  13014.  
  13015.  
  13016.  
  13017.                                      Page -216-
  13018.  
  13019.  
  13020.  
  13021.  
  13022.  
  13023.                           SCL1 Version 2.0 Reference Manual
  13024.  
  13025.  
  13026.                                                                     TagMenu
  13027.  
  13028.           Example:
  13029.  
  13030.           #include <scl1.h>
  13031.           #include <scl1clor.h>
  13032.  
  13033.           struct MenuOpt mo[]={
  13034.              9,35," Option 1 ",'1',
  13035.              10,35," Option 2 ",'2',
  13036.              11,35," Option 3 ",'3',
  13037.              13,35,"  CANCEL  ",'C',
  13038.              14,35,"    OK    ",'O',
  13039.              };
  13040.  
  13041.           main()
  13042.           {
  13043.           int i;
  13044.  
  13045.           Cls(WHITE_BLACK,8,34,15,45);
  13046.           Box(WHITE_BLACK,1,8,34,15,45);
  13047.           if(TagMenu(WHITE_BLACK,BLACK_WHITE,WHITE_BLACK+HIGHLIGHT,5,mo,
  13048.                      35,44,8,15) != -1)
  13049.              {
  13050.              printf("The following options were tagged:\n");
  13051.              for(i=0;i < 3;++i)
  13052.                 {
  13053.                 if(mo[i].String[0] != ' ')
  13054.                    printf("Option %i\n",i+1);
  13055.                 }
  13056.              }
  13057.           else
  13058.              printf("CANCEL was selected\n");
  13059.           }
  13060.  
  13061.  
  13062.  
  13063.  
  13064.  
  13065.  
  13066.  
  13067.  
  13068.  
  13069.  
  13070.  
  13071.  
  13072.  
  13073.  
  13074.  
  13075.  
  13076.                                      Page -217-
  13077.  
  13078.  
  13079.  
  13080.  
  13081.  
  13082.                           SCL1 Version 2.0 Reference Manual
  13083.  
  13084.  
  13085.                                                                  TextWindow
  13086.  
  13087.           Function:    Textwindow
  13088.  
  13089.           Purpose:     Displays text in a window.
  13090.  
  13091.           Declaration: int TextWindow(int Message,TWData *p,...); 
  13092.  
  13093.           Returns:     This is a dialog type function. See Appendix "E" for
  13094.                        the general operation of these functions.  The
  13095.                        return value is a message described in the Messages
  13096.                        section.
  13097.  
  13098.           Parameters:
  13099.  
  13100.           The options must be passed as an array of structures of the type
  13101.           TWData, one array element for each select option:
  13102.  
  13103.           Structure type TWData:
  13104.  
  13105.           typedef struct{
  13106.              int Color;
  13107.              int UpperRow;
  13108.              int LeftCol;
  13109.              int LowerRow;
  13110.              int RightCol;
  13111.              int FrameType;
  13112.              int WrapFlag;
  13113.              int Position;
  13114.              }TWData;
  13115.  
  13116.           where,
  13117.  
  13118.                  Color - color attributes for the window display (integer).
  13119.  
  13120.               UpperRow - upper row coordinate for the window's display
  13121.                          (integer).
  13122.  
  13123.                LeftCol - left column coordinate for the window's display
  13124.                          (integer).
  13125.  
  13126.               LowerRow - lower row coordinate for the window's display
  13127.                          (integer).
  13128.  
  13129.               RightCol - right column coordinate for the window's display
  13130.                          (integer).
  13131.  
  13132.              FrameType - any of the frame types available for the Box or
  13133.                          GSSBox function (integer).
  13134.  
  13135.                                      Page -218-
  13136.  
  13137.  
  13138.  
  13139.  
  13140.  
  13141.                           SCL1 Version 2.0 Reference Manual
  13142.  
  13143.  
  13144.                                                                  TextWindow
  13145.  
  13146.               WrapFlag - flag to indicate if the displayed line will be
  13147.                          truncated or wrapped if the line's length exceeds
  13148.                          the window's width. A value of "0" indicates no
  13149.                          wrap and a value of "1" indicates wrap (integer).
  13150.  
  13151.               Position - structure element used internally to determine the
  13152.                          current position within the window (integer).
  13153.  
  13154.           The following messages can be sent to TextWindow:
  13155.  
  13156.                   TW_INIT - initialize the TWData structure to null and
  13157.                             sets the following default values.
  13158.  
  13159.                              Color - set to white characters in a black
  13160.                                      background or the normal color defined
  13161.                                      by calling SetDialogColors.
  13162.  
  13163.                           LowerRow - set to row "24".
  13164.  
  13165.                           RightCol - set to column "79".
  13166.  
  13167.                         FrameType - set to single line frame.
  13168.  
  13169.                   TW_DRAW - draw the text window to the screen.
  13170.  
  13171.                  TW_WRITE - write the text information to the Text Window.
  13172.  
  13173.                    TW_CLS - clear the window.
  13174.  
  13175.              TW_LINE_DOWN - move the cursor one line down.
  13176.  
  13177.            TW_DRAW_BORDER - draw border around the Text Window.
  13178.  
  13179.                TW_WAIT_ON - text will be written until the window is full
  13180.                             then it stops and waits for a keypress.  When a
  13181.                             key is pressed the window is cleared.
  13182.  
  13183.               TW_WAIT_OFF - when the window is full it returns a
  13184.                             TW_WINDOW_FULL message (default).
  13185.  
  13186.                  TW_RESET - when this message is sent the position
  13187.                             variables are reset to the default value.  If
  13188.                             the exit keys have not been defined they are
  13189.                             set to the default exit keys.
  13190.  
  13191.  
  13192.  
  13193.  
  13194.                                      Page -219-
  13195.  
  13196.  
  13197.  
  13198.  
  13199.  
  13200.                           SCL1 Version 2.0 Reference Manual
  13201.  
  13202.  
  13203.                                                                  TextWindow
  13204.  
  13205.           The following messages can be returned by TextWindow:
  13206.  
  13207.                     TW_OK - the requested action has been performed
  13208.                             successfully.
  13209.  
  13210.            TW_WINDOW_FULL - the Text Window is full.
  13211.  
  13212.           Example:
  13213.  
  13214.           #include <scl1.h>
  13215.           #include <scl1clor.h>
  13216.  
  13217.           char *strings[]={
  13218.           "This strings will be written",
  13219.           "to a Text Window, one by one.",
  13220.           "Several control characters",
  13221.           "like\t\ttab (\\t),\nnew line (\\n)\rand carriage return (\\r)",
  13222.           "are supported."};
  13223.  
  13224.           main()
  13225.           {
  13226.           TWData twd;
  13227.           int i,Mess;
  13228.  
  13229.           TextWindow(TW_INIT,&twd);     /* initialize structure */
  13230.           twd.UpperRow=10;              /* modify position */
  13231.           twd.LowerRow=14;
  13232.           twd.LeftCol=20;
  13233.           twd.RightCol=60;
  13234.  
  13235.              /* in this example we'll check for the WINDOW_FULL message and
  13236.              wait for a key to be pressed before writing anything else */
  13237.  
  13238.           TextWindow(TW_DRAW,&twd);     /* draw */
  13239.           for(i=0;i < 5;++i)
  13240.              {
  13241.              Mess=TextWindow(TW_WRITE,&twd,strings[i]);
  13242.              if(Mess==TW_WINDOW_FULL)   /* window full? */
  13243.                 {
  13244.                 WriteScreen(WHITE_BLACK+HIGHLIGHT,13,21,"Press any key for
  13245.                         more...");
  13246.                 GetKey();
  13247.                 }
  13248.              }
  13249.  
  13250.  
  13251.  
  13252.  
  13253.                                      Page -220-
  13254.  
  13255.  
  13256.  
  13257.  
  13258.  
  13259.                           SCL1 Version 2.0 Reference Manual
  13260.  
  13261.  
  13262.                                                                  TextWindow
  13263.  
  13264.              /* now, we'll get the same effect using the WAIT_ON message,
  13265.                 TextWindow will now stop and wait for a key when the
  13266.                 window is full */
  13267.  
  13268.           TextWindow(TW_DRAW,&twd);
  13269.           TextWindow(TW_WAIT_ON,&twd);
  13270.           for(i=0;i < 5;++i)
  13271.              TextWindow(TW_WRITE,&twd,strings[i]);
  13272.           }
  13273.  
  13274.  
  13275.  
  13276.  
  13277.  
  13278.  
  13279.  
  13280.  
  13281.  
  13282.  
  13283.  
  13284.  
  13285.  
  13286.  
  13287.  
  13288.  
  13289.  
  13290.  
  13291.  
  13292.  
  13293.  
  13294.  
  13295.  
  13296.  
  13297.  
  13298.  
  13299.  
  13300.  
  13301.  
  13302.  
  13303.  
  13304.  
  13305.  
  13306.  
  13307.  
  13308.  
  13309.  
  13310.  
  13311.  
  13312.                                      Page -221-
  13313.  
  13314.  
  13315.  
  13316.  
  13317.  
  13318.                           SCL1 Version 2.0 Reference Manual
  13319.  
  13320.  
  13321.                                                                   TrapInt23
  13322.  
  13323.           Function:    TrapInt23
  13324.  
  13325.           Purpose:     Traps every occurrence of the Control+Break key
  13326.                        combination.  Global variable I23_CtrlBreakFl is
  13327.                        incremented every time this keyboard combination is
  13328.                        pressed.
  13329.  
  13330.           Declaration: void TrapInt23(void);
  13331.  
  13332.           Returns:     Nothing
  13333.  
  13334.           Parameters:  None
  13335.  
  13336.           Example:
  13337.  
  13338.           #include <scl1.h>
  13339.  
  13340.           main()
  13341.           {
  13342.           TrapInt23();
  13343.           printf("Press Ctrl/Break to exit\n");
  13344.           do
  13345.              {
  13346.              }while(I23_CtrlBreakFl==0);
  13347.           }
  13348.  
  13349.  
  13350.  
  13351.  
  13352.  
  13353.  
  13354.  
  13355.  
  13356.  
  13357.  
  13358.  
  13359.  
  13360.  
  13361.  
  13362.  
  13363.  
  13364.  
  13365.  
  13366.  
  13367.  
  13368.  
  13369.  
  13370.  
  13371.                                      Page -222-
  13372.  
  13373.  
  13374.  
  13375.  
  13376.  
  13377.                           SCL1 Version 2.0 Reference Manual
  13378.  
  13379.  
  13380.                                                                   TrapInt24
  13381.  
  13382.           Function:    TrapInt24
  13383.  
  13384.           Purpose:     Critical error interrupt handler.  Displays an error
  13385.                        box showing the critical error that has occurred.
  13386.                        Asks the user if he wants to retry or not the
  13387.                        operation.
  13388.  
  13389.                        This function is useful to avoid the familiar DOS
  13390.                        message "Abort, Retry, Ignore?" from appearing on
  13391.                        your screen.  Also it gives you extra control when
  13392.                        you are performing a series of file operations. If a
  13393.                        file function returns "-1" it means that the user
  13394.                        does not want to retry the operation, in this case
  13395.                        the program can a stop the other I/O operations it
  13396.                        was going to perform.
  13397.  
  13398.                        This function only traps critical errors like: disk
  13399.                        drive door opened, printer off-line, trying to read
  13400.                        an unformatted disk, etc.
  13401.  
  13402.                        To initialize TrapInt24 call it at the beginning of
  13403.                        your program.  It should be called ONLY ONCE.  You
  13404.                        can alter the error box appearance by calling the
  13405.                        SetInt24Colors, Int24ShadowOff and Int24ShadowOn
  13406.                        functions. 
  13407.  
  13408.                        The function saves and restore the screen area where
  13409.                        the error box is displayed. To initialize TrapInt24
  13410.                        call it at the beginning of your program.
  13411.  
  13412.           Declaration: void TrapInt24(void);
  13413.  
  13414.           Returns:     Nothing
  13415.  
  13416.           Parameters:  None
  13417.  
  13418.           Example:
  13419.  
  13420.           #include <scl1.h>
  13421.  
  13422.           main()
  13423.              {
  13424.              TrapInt24();
  13425.              .
  13426.              .
  13427.              }
  13428.           See also SetInt24Colors, Int24ShadowOff and Int24ShadowOn.
  13429.  
  13430.                                      Page -223-
  13431.  
  13432.  
  13433.  
  13434.  
  13435.  
  13436.                           SCL1 Version 2.0 Reference Manual
  13437.  
  13438.  
  13439.                                                                      TSound
  13440.  
  13441.           Function:    TSound
  13442.  
  13443.           Purpose:     Plays a sound of the specified frequency and for a
  13444.                        specified length of time (in hundredths of a
  13445.                        second).
  13446.  
  13447.           Declaration: void TSound(int Frequency, unsigned int Duration);
  13448.  
  13449.           Returns:     Nothing
  13450.  
  13451.           Parameters:
  13452.  
  13453.              Frequency - the note frequency in Hertz (integer).
  13454.  
  13455.               Duration - length of the note in hundredths of a second
  13456.                          (unsigned integer).
  13457.  
  13458.           Example:
  13459.  
  13460.           #include <scl1.h>
  13461.  
  13462.           main()
  13463.              {
  13464.              TSound(1000,100); /* Plays a 1000 Hertz tone for one second */
  13465.              }
  13466.           See the note definitions in header file SCL1SND.H.
  13467.  
  13468.  
  13469.  
  13470.  
  13471.  
  13472.  
  13473.  
  13474.  
  13475.  
  13476.  
  13477.  
  13478.  
  13479.  
  13480.  
  13481.  
  13482.  
  13483.  
  13484.  
  13485.  
  13486.  
  13487.  
  13488.  
  13489.                                      Page -224-
  13490.  
  13491.  
  13492.  
  13493.  
  13494.  
  13495.                           SCL1 Version 2.0 Reference Manual
  13496.  
  13497.  
  13498.                                                                       Video
  13499.  
  13500.           Function:    Video
  13501.  
  13502.           Purpose:     Checks the monitor type.  Detects if the video
  13503.                        adapter in use is either Monochrome or Color. 
  13504.                        Declares and defines the variable VideoSeg (unsigned
  13505.                        int) that holds Video Buffer segment address. (The
  13506.                        VideoConfig function provides additional
  13507.                        information)
  13508.  
  13509.           Declaration: unsigned int Video(void);
  13510.  
  13511.           Returns:     The return value is defined in SCL1.H as MONO if a
  13512.                        monochrome monitor is installed, or COLOR if a color
  13513.                        monitor is installed.
  13514.  
  13515.           Parameters:  None
  13516.  
  13517.           Example:
  13518.  
  13519.           #include <scl1.h>
  13520.  
  13521.           main()
  13522.              {
  13523.              if(Video()==MONO)
  13524.                 printf("You have a monochrome monitor\n");
  13525.              else
  13526.                 printf("You have a color monitor\n");
  13527.              }
  13528.  
  13529.           See also VideoConfig.
  13530.  
  13531.  
  13532.  
  13533.  
  13534.  
  13535.  
  13536.  
  13537.  
  13538.  
  13539.  
  13540.  
  13541.  
  13542.  
  13543.  
  13544.  
  13545.  
  13546.  
  13547.  
  13548.                                      Page -225-
  13549.  
  13550.  
  13551.  
  13552.  
  13553.  
  13554.                           SCL1 Version 2.0 Reference Manual
  13555.  
  13556.  
  13557.                                                                 VideoConfig
  13558.  
  13559.           Function:    VideoConfig
  13560.  
  13561.           Purpose:     Checks the video information of your system.  Fills
  13562.                        a structure with the current video information for
  13563.                        use by other functions.  This function will be
  13564.                        called by the first function that uses direct video
  13565.                        write.  Also sets global variables VC_Monitor,
  13566.                        VC_Mode, VC_Page, VC_Lines, VC_Cols, VC_Retrace and
  13567.                        VC_Segment with the current video information.
  13568.  
  13569.           Declaration: struct VideoData *VideoConfig(void);
  13570.  
  13571.           Returns:     The return value is a pointer to the VideoData
  13572.                        structure.
  13573.  
  13574.           Parameters:
  13575.  
  13576.           The video information is stored in a structure type VideoData:
  13577.           struct VideoData{
  13578.              int Monitor;
  13579.              int Mode;
  13580.              int Page;
  13581.              int Lines;
  13582.              int Cols;
  13583.              unsigned int Segment;
  13584.              int Retrace;
  13585.              };
  13586.  
  13587.           where,
  13588.  
  13589.                monitor - type of monitor detected.  The following types
  13590.                          have been defined in SCL1.H (integer):
  13591.  
  13592.                          VC_MDA   = Monochrome
  13593.                          VC_CGA   = CGA monitor
  13594.                          VC_EGA   = EGA monitor
  13595.                          VC_EGAM  = EGA with monochrome monitor
  13596.                          VC_PGC   = Professional graphic
  13597.                          VC_VGAM  = VGA / monochrome
  13598.                          VC_VGA   = VGA
  13599.                          VC_MCGADC   = MCGA Digital
  13600.                          VC_MCGAAM   = MCGA Analog/mono
  13601.                          VC_MCGAAC   = MCGA Analog/color
  13602.  
  13603.                   Mode - active video mode (integer).
  13604.  
  13605.                   Page - active video page (integer).
  13606.  
  13607.                                      Page -226-
  13608.  
  13609.  
  13610.  
  13611.  
  13612.  
  13613.                           SCL1 Version 2.0 Reference Manual
  13614.  
  13615.  
  13616.                                                                 VideoConfig
  13617.  
  13618.                  Lines - number of rows in current video mode (integer).
  13619.  
  13620.                   Cols - number of columns in current video mode (integer).
  13621.  
  13622.                Segment - segment used by current video mode (unsigned
  13623.                          integer).
  13624.  
  13625.                Retrace - structure element that tells the functions to use
  13626.                          or not to use retrace. If value is to "0" the
  13627.                          direct screen writes will use no retrace if value
  13628.                          is "1" the will use retrace. By default this value
  13629.                          will be set to "0" with all video systems except
  13630.                          VC_CGA.
  13631.  
  13632.           Example:
  13633.  
  13634.           #include <scl1.h>
  13635.  
  13636.           char *vs[]={
  13637.              "",
  13638.              "Monochrome",
  13639.              "CGA",
  13640.              "",
  13641.              "EGA",
  13642.              "EGA - mono",
  13643.              "PGC",
  13644.              "VGA - mono",
  13645.              "VGA",
  13646.              "",
  13647.              "MCGA - digital - color",
  13648.              "MCGA - analog - mono",
  13649.              "MCGA - analog - color",
  13650.              };
  13651.  
  13652.           main()
  13653.           {
  13654.           struct VideoData *vd;
  13655.  
  13656.           vd=VideoConfig();
  13657.           printf("\n  Video system: %s\n",vs[vd->Monitor]);
  13658.           printf("    Video mode: %i\n",vd->Mode);
  13659.           printf("   Active page: %i\n",vd->Page);
  13660.           printf("         Lines: %i\n",vd->Lines);
  13661.           printf("       Columns: %i\n",vd->Cols);
  13662.           printf("Buffer segment: %X\n\n",vd->Segment);
  13663.           }
  13664.           See also Video.
  13665.  
  13666.                                      Page -227-
  13667.  
  13668.  
  13669.  
  13670.  
  13671.  
  13672.                           SCL1 Version 2.0 Reference Manual
  13673.  
  13674.  
  13675.                                                                WaitKeyMouse
  13676.                                                                    WaitTime
  13677.  
  13678.           Function:    WaitKeyMouse
  13679.  
  13680.           Purpose:     Waits for a keystroke or pressing of the left mouse
  13681.                        button.  The function clears the keyboard buffer on
  13682.                        entry.
  13683.  
  13684.           Declaration: unsigned int WaitKeyMouse(void);
  13685.  
  13686.           Returns:     Returns the key's Scan/Ascii code if a key pressed.
  13687.  
  13688.           Parameters:  None
  13689.  
  13690.           Example:
  13691.  
  13692.              WaitKeyMouse();
  13693.  
  13694.           ****************************************************************
  13695.  
  13696.           Function:    WaitTime
  13697.  
  13698.           Purpose:     Sets a delay of X hundredths of a second.
  13699.  
  13700.           Declaration: void WaitTime(unsigned int HSec);
  13701.  
  13702.           Returns:     Nothing
  13703.  
  13704.           Parameters:
  13705.  
  13706.                   HSec - time interval in hundredths of a second.
  13707.  
  13708.           Example:
  13709.  
  13710.              WaitTime(200);  /* Sets a 2 second delay */
  13711.  
  13712.  
  13713.  
  13714.  
  13715.  
  13716.  
  13717.  
  13718.  
  13719.  
  13720.  
  13721.  
  13722.  
  13723.  
  13724.  
  13725.                                      Page -228-
  13726.  
  13727.  
  13728.  
  13729.  
  13730.  
  13731.                           SCL1 Version 2.0 Reference Manual
  13732.  
  13733.  
  13734.                                                                    WFilebox
  13735.  
  13736.           Function:    WFileBox
  13737.  
  13738.           Purpose:     Displays a wide box with the directory information
  13739.                        for loading or selecting files.  Fills a buffer with
  13740.                        the selected file/path.  The function accepts mouse
  13741.                        input.
  13742.  
  13743.           Declaration: int WFileBox(int Message, FBData *p)
  13744.  
  13745.           Returns:     This is a dialog derived function. See Appendix "E"
  13746.                        for a description of the general operation of these
  13747.                        functions.  The return value is a message described
  13748.                        in the Messages section.
  13749.  
  13750.           Parameters:
  13751.  
  13752.           The file box information is given in a structure type FBData as
  13753.           follows:
  13754.  
  13755.           Structure type FBData;
  13756.  
  13757.           typedef struct{
  13758.              int NColor;
  13759.              int RColor;
  13760.              int UpperRow;
  13761.              int LeftCol;
  13762.              int LowerRow;
  13763.              int RightCol;
  13764.              char *Filename;
  13765.              int Attrib;
  13766.              }FBData;
  13767.  
  13768.           where,
  13769.  
  13770.                 NColor - normal color for the file box's display (integer).
  13771.  
  13772.                 RColor - reversed color for the file box's display
  13773.                          (integer).
  13774.  
  13775.               UpperRow - upper row coordinate for the file box's display
  13776.                          (integer).
  13777.  
  13778.  
  13779.  
  13780.  
  13781.  
  13782.  
  13783.  
  13784.                                      Page -229-
  13785.  
  13786.  
  13787.  
  13788.  
  13789.  
  13790.                           SCL1 Version 2.0 Reference Manual
  13791.  
  13792.  
  13793.                                                                    WFilebox
  13794.  
  13795.                LeftCol - left column coordinate for the file box's display
  13796.                          (integer).
  13797.  
  13798.               LowerRow - lower row coordinate for the file box's display
  13799.                          (integer).
  13800.  
  13801.               RightCol - right column coordinate for the file box's display
  13802.                          (integer).
  13803.  
  13804.               Filename - pointer to buffer to hold selected filename. The
  13805.                          search string is placed in the buffer before
  13806.                          calling the function.  If an empty buffer is used
  13807.                          (NO SEARCH STRING SPECIFIED), the function will
  13808.                          place the default path and the "*.*" search string
  13809.                          in the buffer.
  13810.  
  13811.  
  13812.                 Attrib - file attributes as defined by the DOS. Please
  13813.                          refer to Appendix "A", FILE FUNCTIONS, for more
  13814.                          details (integer).
  13815.  
  13816.           Messages:
  13817.  
  13818.           The following messages can be sent to WFilebox:
  13819.  
  13820.                   FB_INIT - initialize the FBData structure to NULL and set
  13821.                             the following default values:
  13822.  
  13823.                             NColor - set to white characters in a black
  13824.                                      background or the normal color defined
  13825.                                      by calling SetDialogColors.
  13826.  
  13827.                             RColor - set to black characters in a white
  13828.                                      background or the reversed color
  13829.                                      defined by calling SetDialogColors.
  13830.  
  13831.                            LeftCol - set to column "20" for 80 column
  13832.                                      displays or to column "0" for 40
  13833.                                      column displays.
  13834.  
  13835.                           LowerRow - set to row "24" for 25 row displays or
  13836.                                      to row "42" for 43 row displays.
  13837.  
  13838.                           RightCol - set to column "39" for 40 column
  13839.                                      display and "79" for 80 column
  13840.                                      displays.
  13841.  
  13842.  
  13843.                                      Page -230-
  13844.  
  13845.  
  13846.  
  13847.  
  13848.  
  13849.                           SCL1 Version 2.0 Reference Manual
  13850.  
  13851.  
  13852.                                                                    WFilebox
  13853.  
  13854.                             Attrib - files and sub-directories.
  13855.  
  13856.                   FB_DRAW - draw the Filebox to the screen.
  13857.  
  13858.                 FB_ACTIVE - browse through the displayed filenames and
  13859.                             permit selection or cancellling of the
  13860.                             operation using the following keys:
  13861.  
  13862.                          Key                      action
  13863.  
  13864.                        Up Arrow         cursor one item up.
  13865.                        Down Arrow       cursor one item down.
  13866.                        Left Arrow       cursor one item to the left.
  13867.                        Right Arrow      cursor one item to the right.
  13868.                        END              cursor to end of file list.
  13869.                        HOME             cursor to beginning of list.
  13870.  
  13871.           The following messages can be returned by WFileBox:
  13872.  
  13873.                     FB_OK - the action requested has been performed and no
  13874.                             selection has been made.
  13875.  
  13876.                 FB_CANCEL - the operation has been cancelled.
  13877.  
  13878.           Example:
  13879.  
  13880.           #include <scl1.h>
  13881.           #include <scl1clor.h>
  13882.  
  13883.           char Buffer[80];
  13884.           int Color1=WHITE_BLACK;
  13885.           int Color2=BLACK_WHITE;
  13886.  
  13887.           main()
  13888.              {
  13889.              FBData fbd;
  13890.              WFileBox(FB_INIT,&fbd); /* initialize the FBData structure */
  13891.              fbd.NColor=Color1;      /* change display colors */
  13892.              fbd.RColor=Color2;
  13893.              fbd.Filename=Buffer;   /* set buffer to hold directory info */
  13894.              fbd.Attrib=F_READ_ONLY+F_HIDDEN+F_SYSTEM+F_DIRECTORY;
  13895.                                     /* set files attributes */
  13896.              WFileBox(FB_DRAW,&fbd);   /* display FileBox */
  13897.              WFileBox(FB_ACTIVE,&fbd); /* let user make a selection */
  13898.              }
  13899.  
  13900.  
  13901.  
  13902.                                      Page -231-
  13903.  
  13904.  
  13905.  
  13906.  
  13907.  
  13908.                           SCL1 Version 2.0 Reference Manual
  13909.  
  13910.  
  13911.                                                                      Window
  13912.           Function:    Window
  13913.  
  13914.           Purpose:     Saves, clears and restores a window.
  13915.  
  13916.           Declaration: void Window(int Color,int UpperRow,int LeftCol,
  13917.                             int LowerRow, int RightCol, char* Flag,
  13918.                             char* Buffer);
  13919.  
  13920.           Returns:     Nothing
  13921.  
  13922.           Parameters:
  13923.  
  13924.                  Color - color attribute for the area to be cleared
  13925.                          (integer).
  13926.  
  13927.               UpperRow - upper left row coordinate of the area (integer).
  13928.  
  13929.                LeftCol - upper left column coordinate of the area
  13930.                          (integer).
  13931.  
  13932.               LowerRow - lower right row coordinate of the area (integer).
  13933.  
  13934.               RightCol - lower right column coordinate of the area
  13935.                          (integer).
  13936.  
  13937.                   Flag - pointer to a variable that holds the action to be
  13938.                          performed:
  13939.  
  13940.                        0  -> save and clear area.
  13941.                        -2 -> save area only.
  13942.                        1  -> restore area (saved and cleared).
  13943.                        -1 -> restore area (saved only).
  13944.  
  13945.                 Buffer - pointer to a buffer to hold the screen
  13946.                          information.
  13947.  
  13948.  
  13949.  
  13950.  
  13951.  
  13952.  
  13953.  
  13954.  
  13955.  
  13956.  
  13957.  
  13958.  
  13959.  
  13960.  
  13961.                                      Page -232-
  13962.  
  13963.  
  13964.  
  13965.  
  13966.  
  13967.                           SCL1 Version 2.0 Reference Manual
  13968.  
  13969.  
  13970.                                                                      Window
  13971.  
  13972.           Notes:
  13973.  
  13974.              1. The flag is toggled automatically every time the function
  13975.                 is called.
  13976.  
  13977.              2. The buffer size is the Number of characters * 2
  13978.  
  13979.           Example:
  13980.  
  13981.           #include <scl1.h>
  13982.           #include <scl1keys.h>
  13983.           #include <scl1clor.h>
  13984.  
  13985.           /* screen data is stored in these buffers, use W_BUF_SIZE macro
  13986.              to calculate buffer size */
  13987.  
  13988.           char buffer1[W_BUF_SIZE(0,0,24,79)];
  13989.           char buffer2[W_BUF_SIZE(9,26,15,52)];
  13990.  
  13991.           main()
  13992.           {
  13993.           char WFlag1=-2;     /* save do not clear screen */
  13994.           char WFlag2=0;      /* save and clear screen */
  13995.  
  13996.           Window(BLACK_WHITE,0,0,24,79,&WFlag1,buffer1);
  13997.           FillBlock(WHITE_BLACK,0,0,24,79,'X');
  13998.           WriteScreenLen(BLACK_WHITE,24,0,70," The whole screen has
  13999.                          been saved, press any key...");
  14000.           GetKey();
  14001.  
  14002.           Window(WHITE_BLACK,9,26,15,52,&WFlag2,buffer2);
  14003.           WriteScreenLen(BLACK_WHITE,24,0,70," A second window was SAVED
  14004.                          AND CLEARED, press any key to restore it...");
  14005.           GetKey();
  14006.  
  14007.           Window(WHITE_BLACK,9,26,15,52,&WFlag2,buffer2);
  14008.  
  14009.           WriteScreenLen(BLACK_WHITE,24,0,70," Press any key to restore
  14010.                          the screen...");
  14011.           GetKey();
  14012.  
  14013.           Window(BLACK_WHITE,0,0,24,79,&WFlag1,buffer1);
  14014.           }
  14015.  
  14016.  
  14017.  
  14018.  
  14019.  
  14020.                                      Page -233-
  14021.  
  14022.  
  14023.  
  14024.  
  14025.  
  14026.                           SCL1 Version 2.0 Reference Manual
  14027.  
  14028.  
  14029.                                                                   WriteChar
  14030.  
  14031.           Function:    WriteChar
  14032.  
  14033.           Purpose:     Writes a character directly to the screen buffer a
  14034.                        specified number of times.
  14035.  
  14036.           Declaration: void WriteChar(int Color, int Row, int Col,
  14037.                             int Count, int Character);
  14038.  
  14039.           Returns:     Nothing
  14040.  
  14041.           Parameters:
  14042.  
  14043.                  Color - color attribute for the character to be displayed
  14044.                          (integer).
  14045.  
  14046.                    Row - row coordinate of position to start display
  14047.                          (integer).
  14048.  
  14049.                    Col - column coordinate of position to start display
  14050.                          (integer).
  14051.  
  14052.                  Count - number of times the character is written
  14053.                          (integer).
  14054.  
  14055.              Character - the character to be displayed (integer).
  14056.  
  14057.           Example:
  14058.  
  14059.           #include <scl1.h>
  14060.           #include <scl1clor.h>
  14061.  
  14062.           int Color1=WHITE_BLACK;
  14063.  
  14064.           main()
  14065.              {
  14066.              WriteChar(Color1,10,0,80,'-');
  14067.              }
  14068.  
  14069.           /* Writes 80 dashes to the screen starting in line 10, column 0*/
  14070.  
  14071.  
  14072.  
  14073.  
  14074.  
  14075.  
  14076.  
  14077.  
  14078.  
  14079.                                      Page -234-
  14080.  
  14081.  
  14082.  
  14083.  
  14084.  
  14085.                           SCL1 Version 2.0 Reference Manual
  14086.  
  14087.  
  14088.                                                                   WriteFile
  14089.  
  14090.           Function:    WriteFile
  14091.  
  14092.           Purpose:     Writes to a file.  The function can also be used to
  14093.                        write to the standard printer, console or any other
  14094.                        standard device if the proper handle number is
  14095.                        specified.
  14096.  
  14097.           Declaration: int WriteFile(int Handle,char *Buffer,
  14098.                            unsigned int Bytes);
  14099.  
  14100.           Returns:     The return value is "0" if no error occurs or the
  14101.                        DOS error code if an error occurs.  (See Appendix
  14102.                        "A", FILE FUNCTIONS, for more information).
  14103.  
  14104.           Parameters:
  14105.  
  14106.                 Handle - handle number given by DOS when you open or create
  14107.                          a file (integer).
  14108.  
  14109.                 Buffer - pointer to the buffer that will hold the data.
  14110.  
  14111.                  Bytes - number of bytes to write (unsigned integer).
  14112.  
  14113.           Example:
  14114.  
  14115.           #include <scl1.h>
  14116.           /* This is the source code of the Buf2Disk function */
  14117.  
  14118.           Buf2Disk(char *Filename,char *Buffer,unsigned int Bytes)
  14119.              {
  14120.              int i,handle;
  14121.  
  14122.              if(i=CreateFile(Filename,&handle,F_ARCHIVE))
  14123.                 return(i);
  14124.  
  14125.              if(i=WriteFile(handle,Buffer,Bytes))
  14126.                 {
  14127.                 if(i > 0)
  14128.                    CloseFile(handle);
  14129.                        return(i);
  14130.                 }
  14131.              return(CloseFile(handle));
  14132.              }
  14133.  
  14134.  
  14135.  
  14136.  
  14137.  
  14138.                                      Page -235-
  14139.  
  14140.  
  14141.  
  14142.  
  14143.  
  14144.                           SCL1 Version 2.0 Reference Manual
  14145.  
  14146.  
  14147.                                                                 WriteOffLen
  14148.  
  14149.           Function:    WriteOffLen
  14150.  
  14151.           Purpose:     Writes a string directly to the video buffer. The
  14152.                        length to display is specified.  If the string is
  14153.                        shorter than the specified length, the remaining
  14154.                        spaces are filled with the space character. The
  14155.                        display position is specified as an offset from the
  14156.                        home position.
  14157.  
  14158.           Declaration: void WriteOffLen(int Color, int Offset, int Count,
  14159.                             char * String);
  14160.  
  14161.           Returns:     Nothing
  14162.  
  14163.           Parameters:
  14164.  
  14165.                  Color - color attribute of the desired display (integer).
  14166.  
  14167.                 Offset - offset from the home position where to display the
  14168.                          string.  The offset is calculated as follows:
  14169.                          number of columns multiplied by "2" multiplied by
  14170.                          the number of rows plus the desired column
  14171.                          position multiplied by "2" (integer).
  14172.  
  14173.                  Count - length to display (integer).
  14174.  
  14175.                 String - pointer to the string to be displayed.
  14176.  
  14177.           Example:
  14178.  
  14179.           #include <scl1.h>
  14180.           #include <scl1clor.h>
  14181.  
  14182.           int Color1=WHITE_BLACK;
  14183.  
  14184.           main()
  14185.              {
  14186.              WriteOffLen(Color1,1500,15,"This is a test. ");
  14187.              }
  14188.  
  14189.           /* Displays the string with a length of 15 character in position
  14190.              offset 1500 */
  14191.  
  14192.  
  14193.  
  14194.  
  14195.  
  14196.  
  14197.                                      Page -236-
  14198.  
  14199.  
  14200.  
  14201.  
  14202.  
  14203.                           SCL1 Version 2.0 Reference Manual
  14204.  
  14205.  
  14206.                                                                 WriteOffset
  14207.  
  14208.           Function:    WriteOffset
  14209.  
  14210.           Purpose:     Writes a character directly to the video buffer. The
  14211.                        display position is specified as an offset from the
  14212.                        home position.
  14213.  
  14214.           Declaration: void WriteOffset(int Color, int Offset,
  14215.                             int Character);
  14216.  
  14217.           Returns:     Nothing
  14218.  
  14219.           Parameters:
  14220.  
  14221.                  Color - color attribute of the desired display (integer).
  14222.  
  14223.                 Offset - offset from the home position where to display the
  14224.                          string.  The offset is calculated as follows:
  14225.                          number of columns multiplied by "2" multiplied by
  14226.                          the number of rows plus the desired column
  14227.                          position multiplied by "2" (integer).
  14228.  
  14229.              Character - character to be displayed (integer).
  14230.  
  14231.           Example:
  14232.  
  14233.           #include <scl1.h>
  14234.           #include <scl1clor.h>
  14235.  
  14236.           #define ROW  10
  14237.           #define COL  60
  14238.  
  14239.           char string[]="IN GIRUM IMUS NOCTE ET CONSUMIMUR IGNI";
  14240.  
  14241.           main()
  14242.           {
  14243.           int offset,i;
  14244.  
  14245.           InitVideo();
  14246.           WriteScreen(BLACK_WHITE,ROW-1,23,string);
  14247.           offset = ROW * VC_Cols * 2 + COL  * 2;
  14248.           for(i=0;i < sizeof(string)-1;++i,offset-=2)
  14249.              WriteOffset(BLACK_WHITE,offset,string[i]);
  14250.           }
  14251.  
  14252.  
  14253.  
  14254.  
  14255.  
  14256.                                      Page -237-
  14257.  
  14258.  
  14259.  
  14260.  
  14261.  
  14262.                           SCL1 Version 2.0 Reference Manual
  14263.  
  14264.  
  14265.                                                                 WriteScreen
  14266.  
  14267.           Function:    WriteScreen
  14268.  
  14269.           Purpose:     Writes a string directly to the video buffer.
  14270.                        Supports control character "\n".
  14271.  
  14272.           Declaration: void WriteScreen(int Attribute, int Row,
  14273.                            int Column, char* StringAdr);
  14274.  
  14275.           Returns:     Nothing
  14276.  
  14277.           Parameters:
  14278.  
  14279.              Attribute - color attribute of the desired display (integer).
  14280.  
  14281.                    Row - row coordinate where to display the string
  14282.                          (integer).
  14283.  
  14284.                 Column - column coordinate where to display the string
  14285.                          (integer).
  14286.  
  14287.              StringAdr - pointer to the string to be displayed.
  14288.  
  14289.           Example:
  14290.  
  14291.           #include <scl1.h>
  14292.           #include <scl1clor.h>
  14293.  
  14294.           char Mess[]="SCL1's screen related functions will let you:\n\n"
  14295.                       "   ∙ Write directly to the screen.\n\n"
  14296.                       "   ∙ Draw boxes.\n\n"
  14297.                       "   ∙ Clear or scroll any area of your screen.\n\n"
  14298.                       "   ∙ Save and restore any screen area.\n\n"
  14299.                       "   ∙ Control cursor size and many more...";
  14300.  
  14301.           int Color1=WHITE_BLACK;
  14302.  
  14303.           main()
  14304.              {
  14305.              WriteScreen(Color1,4,20,Mess3);
  14306.              }
  14307.  
  14308.           /* Displays the string Mess3[] in row 4, column 20 */
  14309.  
  14310.  
  14311.  
  14312.  
  14313.  
  14314.  
  14315.                                      Page -238-
  14316.  
  14317.  
  14318.  
  14319.  
  14320.  
  14321.                           SCL1 Version 2.0 Reference Manual
  14322.  
  14323.  
  14324.                                                              WriteScreenLen
  14325.  
  14326.           Function:    WriteScreenLen
  14327.  
  14328.           Purpose:     Writes a string directly to the video buffer. The
  14329.                        length to display is specified.  If the string is
  14330.                        shorter than the specified length, the remaining
  14331.                        spaces are filled with the space character.
  14332.  
  14333.           Declaration: void WriteScreenLen(int Color, int Row, int Col,
  14334.                             int Count,char *String);
  14335.  
  14336.           Returns:     Nothing
  14337.  
  14338.           Parameters:
  14339.  
  14340.                  Color - color attribute of the desired display (integer).
  14341.  
  14342.                    Row - row coordinate where to display the string
  14343.                          (integer).
  14344.  
  14345.                    Col - column coordinate where to display the string
  14346.                          (integer).
  14347.  
  14348.                  Count - length to display (integer).
  14349.  
  14350.                 String - pointer to the string to be displayed.
  14351.  
  14352.           Example:
  14353.  
  14354.           #include <scl1.h>
  14355.           #include <scl1clor.h>
  14356.  
  14357.           char string1[]="Only the characters that fit inside the box will
  14358.                           written to the screen.";
  14359.           char string2[]="WriteScreenLen blanks the screen if the
  14360.                           string\nis shorter than the length specified:";
  14361.           char *strings[]={"1234567890",
  14362.                             "12345678",
  14363.                             "12345"};
  14364.  
  14365.  
  14366.  
  14367.  
  14368.  
  14369.  
  14370.  
  14371.  
  14372.  
  14373.  
  14374.                                      Page -239-
  14375.  
  14376.  
  14377.  
  14378.  
  14379.  
  14380.                           SCL1 Version 2.0 Reference Manual
  14381.  
  14382.  
  14383.                                                              WriteScreenLen
  14384.  
  14385.           main()
  14386.           {
  14387.           int TopRow,LeftCol,BottomRow,wide,i;
  14388.  
  14389.           for(TopRow=LeftCol=4,BottomRow=TopRow+2,wide=72;wide > 4;
  14390.               wide-=2,++LeftCol)
  14391.              {
  14392.              Box(BLACK_WHITE,0,TopRow,LeftCol,BottomRow,LeftCol+wide);
  14393.              WriteScreenLen(BLACK_WHITE,TopRow+1,LeftCol+1,wide-1,string1);
  14394.              GetKey();
  14395.              }
  14396.           Cls(BLACK_WHITE,10,10,14,70);
  14397.           WriteScreen(BLACK_WHITE,11,17,string2);
  14398.           for(i=0;i < 3;++i)
  14399.              {
  14400.              WriteScreenLen(BLACK_WHITE,13,35,34,strings[i]);
  14401.              GetKey();
  14402.              }
  14403.           }
  14404.  
  14405.  
  14406.  
  14407.  
  14408.  
  14409.  
  14410.  
  14411.  
  14412.  
  14413.  
  14414.  
  14415.  
  14416.  
  14417.  
  14418.  
  14419.  
  14420.  
  14421.  
  14422.  
  14423.  
  14424.  
  14425.  
  14426.  
  14427.  
  14428.  
  14429.  
  14430.  
  14431.  
  14432.  
  14433.                                      Page -240-
  14434.  
  14435.  
  14436.  
  14437.  
  14438.  
  14439.                           SCL1 Version 2.0 Reference Manual
  14440.  
  14441.  
  14442.                                                                       YesNo
  14443.  
  14444.           Function:    YesNo
  14445.  
  14446.           Purpose:     Displays a YES/NO query box with mouse control
  14447.                        buttons.  The original screen is restored on exit.
  14448.  
  14449.           Declaration: int YesNo(int NColor,int RColor,int Selection,
  14450.                            char *p);
  14451.  
  14452.           Returns: A value of "1" is returned if the YES box is selected or
  14453.                    clicked with the mouse and a value of "2" if the NO box
  14454.                    is selected or clicked.
  14455.  
  14456.           Parameters:
  14457.  
  14458.                 NColor - color attribute for the YES/NO box (integer).
  14459.  
  14460.                 RColor - color attribute of the selected option (integer).
  14461.  
  14462.              Selection - default selection (integer).
  14463.  
  14464.                      p - pointer to the question whose answer is seeked.
  14465.  
  14466.           Example:
  14467.  
  14468.           #include <scl1.h>
  14469.           #include <scl1clor.h>
  14470.  
  14471.           #define YES 1
  14472.           #define NO  2
  14473.  
  14474.           int Color1=WHITE_BLACK;
  14475.           int Color2=BLACK_WHITE;
  14476.  
  14477.           main()
  14478.           {
  14479.           do
  14480.              {
  14481.              if(YesNo(Color1,Color2,"Turn YesNo Box\nShadow On?") == YES)
  14482.                 YesNoShadowOn();
  14483.              if(YesNo(Color1,Color2,"Turn YesNo Box\nShadow Off?") == YES)
  14484.                 YesNoShadowOff();
  14485.              }while(YesNo(Color1,Color2,NO,"Exit to DOS?") != YES);
  14486.           }
  14487.  
  14488.           See YesNoShadowOff and YesNoShadowOn
  14489.  
  14490.  
  14491.  
  14492.                                      Page -241-
  14493.  
  14494.  
  14495.  
  14496.  
  14497.  
  14498.                           SCL1 Version 2.0 Reference Manual
  14499.  
  14500.  
  14501.                                                              YesNoShadowOff
  14502.                                                               YesNoShadowOn
  14503.  
  14504.           Function:    YesNoShadowOff
  14505.                        YesNoShadowOn
  14506.  
  14507.           Purpose:     Displays or disable a shadow effect when using the
  14508.                        YesNo function.  After any of these functions are
  14509.                        called all subsequent calls to the YesNo function
  14510.                        will be displayed with (or without) a shadow effect.
  14511.  
  14512.           Declaration: void YesNoShadowOff(void);
  14513.                        void YesNoShadowOn(void);
  14514.  
  14515.           Returns:     Nothing.
  14516.  
  14517.           Parameters:  None.
  14518.  
  14519.           Example:
  14520.  
  14521.  
  14522.           #include <scl1.h>
  14523.           #include <scl1clor.h>
  14524.  
  14525.           #define YES 1
  14526.           #define NO  2
  14527.  
  14528.           int Color1=WHITE_BLACK;
  14529.           int Color2=BLACK_WHITE;
  14530.  
  14531.           main()
  14532.           {
  14533.           do
  14534.              {
  14535.              if(YesNo(Color1,Color2,"Turn YesNo Box\nShadow On?") == YES)
  14536.                 YesNoShadowOn();
  14537.              if(YesNo(Color1,Color2,"Turn YesNo Box\nShadow Off?") == YES)
  14538.                 YesNoShadowOff();
  14539.              }while(YesNo(Color1,Color2,NO,"Exit to DOS?") != YES);
  14540.           }
  14541.  
  14542.           See YesNo.
  14543.  
  14544.  
  14545.  
  14546.  
  14547.  
  14548.  
  14549.  
  14550.  
  14551.                                      Page -242-
  14552.  
  14553.  
  14554.  
  14555.  
  14556.  
  14557.                                     Appendix "A"
  14558.  
  14559.  
  14560.                                FILE RELATED FUNCTIONS
  14561.  
  14562.           SCL1's file related functions rely on DOS services to work with
  14563.           files.  They provide an alternative to the standard library
  14564.           functions with a main objective of providing an easier way to
  14565.           trap and display error related information.
  14566.  
  14567.           You can classify errors in two groups; critical and non-
  14568.           critical.  Critical errors are those that generate an interrupt
  14569.           0x24 like, for example, a disk drive door left opened.  This is
  14570.           the type of error that generates the DOS message "Retry, Abort,
  14571.           Ignore?".  Non-critical errors are reported by the system but do
  14572.           not generate an interrupt 0x24 like, for example, not finding a
  14573.           file.
  14574.  
  14575.           SCL1 functions deals with non-critical errors in a simple way. 
  14576.           Most file functions return zero if the operation was successful,
  14577.           otherwise they return the DOS error code that identifies the type
  14578.           of error.  Your program can then process the error code or you
  14579.           can call the ErrorBox function that will display the error
  14580.           message.  You can add your own errors to ErrorBox default error
  14581.           messages (see ErrorBox).
  14582.  
  14583.           To deal with DOS critical errors, SCL1 has the TrapInt24
  14584.           function.  Call this function at the beginning of your program
  14585.           (it must be done only once) and any subsequent critical errors
  14586.           will be handled by SCL1.  Now if DOS generates an interrupt 0x24,
  14587.           instead of its standard message, a window will be opened in the
  14588.           screen's center and a message indicating the type of error, disk
  14589.           or printer related, and asking the user if he wants or not to
  14590.           retry operation will be displayed.  On exit the original screen
  14591.           will be restored.
  14592.  
  14593.           Once you have initialized TrapInt24, SCL1's file related
  14594.           functions will return -1 to indicate a DOS critical error if the
  14595.           user decided NOT TO retry the operation.  If the user decides to
  14596.           retry the operation and it is completed successfully, no error
  14597.           code is reported.
  14598.  
  14599.           As you see, trapping critical errors and non-critical errors can
  14600.           be easily integrated to your program by using TrapInt24 and
  14601.           ErrorBox.  SCL1's way of displaying error message is specially
  14602.           appropriate for programs that are not command-line oriented. 
  14603.           Also notice that you don't have to use ErrorBox when a critical
  14604.           error is reported since TrapInt24 has its own way of displaying
  14605.           error messages.
  14606.  
  14607.           Refer to the DOS Technical Reference for more information about
  14608.           error code numbers.
  14609.  
  14610.                                      Page -243-
  14611.  
  14612.  
  14613.  
  14614.  
  14615.  
  14616.                                     Appendix "A"
  14617.  
  14618.           The following pseudo-code shows how to deal with errors:
  14619.  
  14620.                 Returned error code > than 0 ?
  14621.  
  14622.                    Call ErrorBox with error number.
  14623.  
  14624.                 Error code = -1 ?
  14625.  
  14626.                    DOS Critical error, the user choose not to retry
  14627.                    operation. No need to call ErrorBox since the error
  14628.                    message has already been displayed by TrapInt24.
  14629.  
  14630.                 else
  14631.  
  14632.                    Operation was successful.
  14633.  
  14634.           The following list show the most common DOS error codes:
  14635.  
  14636.                    2   File not found
  14637.                    3   Path not found
  14638.                    4   No handles left
  14639.                    5   Access denied
  14640.                    6   Invalid handle
  14641.                    15  Invalid drive
  14642.                    16  Attempt to remove current directory
  14643.                    29  Write Fault
  14644.                    30  Read Fault
  14645.  
  14646.              SCL1's Error codes:
  14647.  
  14648.                    255   File too big   (used by File2Buf)
  14649.                    -1  Dos Critical error
  14650.                    -2  Drive not valid (used by GetDiskFreeSpace)
  14651.  
  14652.           SCL1 gives you direct access to DOS file related functions. You
  14653.           need to understand DOS's way of working with files for using
  14654.           them.  There are many books that could help you. The general
  14655.           procedure is:
  14656.  
  14657.              First you must open or create a file.  Use OpenFile or
  14658.              CreateFile to do it.  The first function opens an existing
  14659.              file (error is reported if the file is not found ), while the
  14660.              second one creates a file if the file is not found or
  14661.              truncates an existing file to 0.  When you open or create a
  14662.              file DOS gives you a "Handle".  A handle is a number that you
  14663.              will use to refer to this file when performing any other
  14664.              operations like reading, writing, etc.
  14665.  
  14666.  
  14667.  
  14668.  
  14669.                                      Page -244-
  14670.  
  14671.  
  14672.  
  14673.  
  14674.  
  14675.                                     Appendix "A"
  14676.  
  14677.              Once you have a handle to a file you can write or read data.
  14678.              To do it use ReadFile or WriteFile. This functions will read
  14679.              or write any number of bytes to or from a buffer you specify.
  14680.              Files functions under DOS have a read/write pointer. In other
  14681.              words, when you read 200 bytes the file pointer will point to
  14682.              byte 201. This means that next time you read, you will read
  14683.              byte 201. This pointer is automatically moved by ReadFile and
  14684.              WriteFile. You can move this pointer yourself using MoveFilePt
  14685.              and MoveFilePt2Offset.
  14686.  
  14687.              Once you have finished working with your file, you must close
  14688.              the file by using CloseFile.
  14689.  
  14690.              As you see working with files under DOS is a three step
  14691.              process: 1) Open/Create File, 2) Read/Write, 3) Close File.
  14692.  
  14693.              SCL1 offers another, and probably easier, way to work with
  14694.              files. You can read a file to a buffer or write a buffer to a
  14695.              file in just one step using File2Buf and Buf2Disk. You don't
  14696.              have to care about opening or closing files with this
  14697.              functions. But you will have to read or write the whole
  14698.              file/buffer when you use them.
  14699.  
  14700.  
  14701.  
  14702.  
  14703.  
  14704.  
  14705.  
  14706.  
  14707.  
  14708.  
  14709.  
  14710.  
  14711.  
  14712.  
  14713.  
  14714.  
  14715.  
  14716.  
  14717.  
  14718.  
  14719.  
  14720.  
  14721.  
  14722.  
  14723.  
  14724.  
  14725.  
  14726.  
  14727.  
  14728.                                      Page -245-
  14729.  
  14730.  
  14731.  
  14732.  
  14733.  
  14734.                                     Appendix "B"
  14735.  
  14736.  
  14737.                                MOUSE RELATED FUNCTIONS
  14738.  
  14739.           All SCL1 mouse related functions are based on an interrupt
  14740.           service routine (ISR) that updates a series of variables
  14741.           according to the mouse current state.  If you do not initialize
  14742.           this ISR you would not be able to use any mouse related routine. 
  14743.           Mouse initialization can be performed in several ways. 
  14744.  
  14745.           The CheckMouse function can be used to check if the mouse
  14746.           hardware/software is installed:
  14747.  
  14748.                    if(CheckMouse())
  14749.                        we have a mouse !
  14750.  
  14751.           Once you have verified that the mouse is installed you should
  14752.           reset the mouse software to its defaults using ResetMouse and
  14753.           then proceed to install the ISR using SetMouseIsr:
  14754.  
  14755.                    if(CheckMouse())
  14756.                        {
  14757.                        ResetMouse();
  14758.                        SetMouseIsr();
  14759.  
  14760.           Now you can call any mouse related functions. You can begin by
  14761.           calling ShowMouse to make the mouse visible.
  14762.  
  14763.           NOTE: Before returning to DOS should program must un-install the
  14764.           ISR using ResetMouse(). Failure to do so might cause
  14765.           unpredictable problems.
  14766.  
  14767.           All these steps can be simplified by using InitMouse function.
  14768.           This function performs all the operations described above
  14769.           including resetting the ISR:
  14770.  
  14771.           If you want a visible mouse cursor use:
  14772.  
  14773.                 InitMouse(IM_SHOW);
  14774.  
  14775.           If you want an invisible mouse cursor use:
  14776.  
  14777.                 InitMouse(IM_NO_SHOW);
  14778.  
  14779.           Once the mouse is initialized a series of variables are updated
  14780.           according to mouse events (see SetMouseIsr). Your program can
  14781.           check these variables at any moment to read the mouse position
  14782.           and the mouse buttons state.
  14783.  
  14784.  
  14785.  
  14786.  
  14787.                                      Page -246-
  14788.  
  14789.  
  14790.  
  14791.  
  14792.  
  14793.                                     Appendix "B"
  14794.  
  14795.           NOTE: If you change video modes you should reset the mouse and
  14796.           re-initialize it.  The re-initialization MUST NOT be done using
  14797.           InitMouse:
  14798.  
  14799.                 InitMouse(IM_SHOW);
  14800.                    .
  14801.                    .
  14802.                    ResetMouse();
  14803.                    SetVideoMode(1);
  14804.  
  14805.                    if(CheckMouse())
  14806.                        {
  14807.                        ResetMouse();
  14808.                        SetMouseIsr();
  14809.                        ShowMouse();
  14810.                        }
  14811.  
  14812.  
  14813.  
  14814.  
  14815.  
  14816.  
  14817.  
  14818.  
  14819.  
  14820.  
  14821.  
  14822.  
  14823.  
  14824.  
  14825.  
  14826.  
  14827.  
  14828.  
  14829.  
  14830.  
  14831.  
  14832.  
  14833.  
  14834.  
  14835.  
  14836.  
  14837.  
  14838.  
  14839.  
  14840.  
  14841.  
  14842.  
  14843.  
  14844.  
  14845.  
  14846.                                      Page -247-
  14847.  
  14848.  
  14849.  
  14850.  
  14851.  
  14852.                                     Appendix "C"
  14853.  
  14854.  
  14855.                               SCREEN RELATED FUNCTIONS
  14856.  
  14857.           All SCL1's screen related functions write directly to the video
  14858.           buffer.  Configuration according to monitor type is done
  14859.           automatically when the first screen related function is called.
  14860.           During this configuration, SCL1's Video function will determine
  14861.           the type of monitor, the video buffer memory address and wether
  14862.           it is necessary to wait for the monitor retrace to avoid snow.
  14863.  
  14864.           To learn about the video configuration your program will be using
  14865.           you should call VideoConfig. This function returns a pointer to a
  14866.           structure that holds the information about the video adapter
  14867.           you'll be using. The structure format is as follows:
  14868.  
  14869.           struct VideoData{
  14870.              int Monitor;            /* Monitor type */
  14871.              int Mode;               /* Active video mode */
  14872.              int Page;               /* Active video page */
  14873.              int Lines;              /* Number of lines in video mode */
  14874.              int Cols;               /* Number of columns in video mode */
  14875.              unsigned int Segment;   /* video buffer segment address */
  14876.              int Retrace;            /* =1 if retrace is to be done */
  14877.              };
  14878.  
  14879.           Monitor types are define in SCL1.H :
  14880.  
  14881.              VC_MDA    = Monochrome
  14882.              VC_CGA    = CGA monitor
  14883.              VC_EGA    = EGA monitor
  14884.              VC_EGAM   = EGA with monochrome monitor
  14885.              VC_PGC    = Professional graphic
  14886.              VC_VGAM   = VGA / monochrome
  14887.              VC_VGA    = VGA
  14888.              VC_MCGADC = MCGA Digital
  14889.              VC_MCGAAM = MCGA Analog/mono
  14890.              VC_MCGAAC = MCGA Analog/color
  14891.  
  14892.           If you do not need all the video information you can call Video.
  14893.           This functions returns wether the monitor is color or mono:
  14894.  
  14895.              if(Video()==COLOR)
  14896.                 color monitor
  14897.              else
  14898.                 mono monitor
  14899.  
  14900.           NOTE: COLOR & MONO are defined in SCL1.H as the segment address
  14901.           of the Video Buffer (0xb800 for color 0xb000 for mono).
  14902.  
  14903.  
  14904.  
  14905.                                      Page -248-
  14906.  
  14907.  
  14908.  
  14909.  
  14910.  
  14911.                                     Appendix "C"
  14912.  
  14913.           SCL1 video functions work only in alphanumeric video modes.  You
  14914.           can initialize your system to one of this modes (3 in case of
  14915.           color, 7 in case of mono) by calling InitVideo at the beginning
  14916.           of your program.  Most of the times this won't be necessary since
  14917.           they are the default modes, but is not a bad idea to use
  14918.           InitVideo just to make sure.  Be aware that when you call
  14919.           InitVideo the screen will be cleared and the cursor moved to the
  14920.           screen's home position. Remember that version 2.0 of SCL1
  14921.           supports only video modes 0 - 3 and 7.
  14922.  
  14923.           SCL1's screen related functions always write to the active video
  14924.           page. You can change the video page using SetVideoPage. Be sure
  14925.           to specify a valid page for your system. You can force a function
  14926.           to write to a non-active video page by modifying the VC_Page
  14927.           variable before calling the desired video function, be sure to
  14928.           restore the correct value of VC_Page.
  14929.  
  14930.           Retrace will be done only if a CGA type adapter is found.  SCL1
  14931.           functions will not wait for the video retrace if an EGA adapter
  14932.           is found.  Yet you can force them to do the retrace by changing
  14933.           the variable VC_Retrace to 1. For example:
  14934.  
  14935.              if(Video()==COLOR)
  14936.                 VC_Retrace=1;
  14937.  
  14938.           You must set this variable to 1 AFTER having called Video or any
  14939.           other screen related function.
  14940.  
  14941.           EGA 43 lines and VGA 50 lines are now supported by SCL1.
  14942.           SetVideo4350 sets the mode to 43 or 50 lines depending on the
  14943.           monitor you have. SetVideo25 restores video mode to the default
  14944.           25 lines.
  14945.  
  14946.  
  14947.  
  14948.  
  14949.  
  14950.  
  14951.  
  14952.  
  14953.  
  14954.  
  14955.  
  14956.  
  14957.  
  14958.  
  14959.  
  14960.  
  14961.  
  14962.  
  14963.  
  14964.                                      Page -249-
  14965.  
  14966.  
  14967.  
  14968.  
  14969.  
  14970.                                     Appendix "D"
  14971.  
  14972.  
  14973.                                   SCL1 HEADER FILES
  14974.  
  14975.              SCL1.H -  SCL1 structures, functions prototypes and constant
  14976.                        definitions.
  14977.  
  14978.           SCL1KEYS.H - SCAN-ASCII code of most used keys. F1 - F10 (with
  14979.                        shift, alt and control), numeric key-pad keys and A-
  14980.                        Z (with alt and control) are defined.
  14981.  
  14982.           SCL1CLOR.H - Color definitions. 
  14983.  
  14984.                    Example: WHITE_BLUE stands for white characters on blue
  14985.                    background. 
  14986.  
  14987.                    Colors can be highligted and the blink attribute is also
  14988.                    defined. Example:
  14989.  
  14990.                    WHITE_RED | HIGHLIGHT
  14991.                    WHITE_RED | BLINK
  14992.  
  14993.           SCL1SND.H -  Definition of musical notes frequency in hertz to be
  14994.                        used with sound related functions.
  14995.  
  14996.                        Syntax  TS_X[y]?    , were:
  14997.  
  14998.                        TS = TSound id
  14999.                        X = musical note (C,D,E,F,G,A,B)
  15000.                        y = s means sharp, f means flat (optional)
  15001.                        ? = octave (1 - 7)
  15002.  
  15003.                        Examples:  TS_Df4 = D flat, fourth octave
  15004.                             TS_C4 = C, fourth octave (middle C)
  15005.  
  15006.           SCL1OLD.H -  Use this file only to compile source-code developed
  15007.                        with SCL1 version 1. Several global variables names
  15008.                        and constant definitions has changed in version 2.
  15009.                        SCL1OLD.H redefines older names to the new names
  15010.                        used in SCL1 version 2.
  15011.  
  15012.  
  15013.  
  15014.  
  15015.  
  15016.  
  15017.  
  15018.  
  15019.  
  15020.  
  15021.  
  15022.  
  15023.                                      Page -250-
  15024.  
  15025.  
  15026.  
  15027.  
  15028.  
  15029.                                     Appendix "E"
  15030.  
  15031.  
  15032.                                 DIALOG TYPE FUNCTIONS
  15033.  
  15034.           OVERVIEW
  15035.  
  15036.           In this version of SCL1 several new functions have been added
  15037.           that utilize a dialog scheme.  The idea behind these functions is
  15038.           to make them as flexible as possible, permitting the programmer
  15039.           to set or specify almost any available parameter.  This
  15040.           flexibility adds complexity and, in order to make them as
  15041.           friendly as possible, a dialog scheme has been used.
  15042.  
  15043.           During program development a need arises to perform complex task. 
  15044.           For example; let's say you need to get user input, but you want
  15045.           to add the flexibility of being able to check for a help key or
  15046.           for a keystroke combination that will insert a block at the
  15047.           current cursor position. Or you need a window were the user can
  15048.           browse through a list of items, yet you want to know exactly at
  15049.           any moment what item is being highlighted by the user so that you
  15050.           can display help information or show the selected item in another
  15051.           window.  These types of requirements usually require you to write
  15052.           a custom procedure.  Most library functions are not designed to
  15053.           handle these special requirements. The dialog type functions have
  15054.           been designed to permit you to handle these types of problems.
  15055.  
  15056.           To permit this level of flexibility, the dialog type functions
  15057.           make use of a message interchange scheme.  You can call the
  15058.           function as many times as required, each time requesting a given
  15059.           action.  The function will return a message that gives you the
  15060.           results or status of the requested action.
  15061.  
  15062.           The general way to use this functions is as follows:
  15063.  
  15064.           You can first call the function with an initialization message.
  15065.           This will take care of initializing the structure elements to
  15066.           some predetermined values and setting the function's initial
  15067.           conditions.  Then you can call the function with a message
  15068.           requesting a display.  This will instruct the function to draw or
  15069.           display to the screen the desired object (like a scroll window
  15070.           display).  Now that there is a display you will like to make the
  15071.           function active so that it can perform the desired task.  While
  15072.           the function is active it will keep sending back messages
  15073.           informing you of what is happening, for example, that an illegal
  15074.           key has been pressed (so display an error or help message, or
  15075.           beep the console to warn the user, etc.) or that the cursor has
  15076.           changed position, etc.  You can then analyze these returned
  15077.           messages and respond with a given action or you can ignore them.
  15078.           In fact, you can request the function to do anything it is
  15079.           capable of doing, for example, in the case of data entry field
  15080.           (like LineEditor), to move the cursor to any position, reformat
  15081.  
  15082.                                      Page -251-
  15083.  
  15084.  
  15085.  
  15086.  
  15087.  
  15088.                                     Appendix "E"
  15089.  
  15090.           or even change the data, insert a new character, etc. The
  15091.           messages have been defined in the header file as english-like
  15092.           messages to permit a friendly interface.
  15093.  
  15094.           Most of the parameters needed to configure the functions are
  15095.           included as elements of one or several structures.  These
  15096.           structure(s) need to be initialized before any call to the
  15097.           function is made.  The structures contain a lot of parameters and
  15098.           it might look as if they involve a lot of effort to define them. 
  15099.           With the aid of SSG (SCL1 Screen Generator program) you can
  15100.           define these structures very easily.  Please refer to the SSG
  15101.           reference manual included in this package.
  15102.  
  15103.           SENDING MESSAGES TO DIALOG TYPE FUNCTIONS
  15104.  
  15105.           Every effort has been made to make the dialog functions as
  15106.           uniform as possible.  Most functions use the same messages to
  15107.           perform the same tasks.
  15108.  
  15109.              INITIALIZING THE PARAMETER STRUCTURES:
  15110.  
  15111.                 You can define the parameter structures in two different
  15112.                 ways.  One way is to indicate a value for each parameter. 
  15113.                 The other way is to call the functions with a "INIT"
  15114.                 message, this will assign default values to most
  15115.                 parameters, then you can modify them according to your
  15116.                 taste.  Which method to use depends on how many of the
  15117.                 parameters you will like to have control of.
  15118.  
  15119.                 For example, let us initialize a ScrollWindow structure
  15120.                 using the two methods:
  15121.  
  15122.                 1) Using SW_INIT message:
  15123.  
  15124.                 #include <scl1.h>
  15125.  
  15126.                 /* This is the data you want to display in your 
  15127.                    scroll window */
  15128.  
  15129.                 char *swdbuf[]={
  15130.                    "First Item",
  15131.                    "Second Item",
  15132.                    0};
  15133.  
  15134.                 main()
  15135.                 {
  15136.                    SWData swd;
  15137.  
  15138.  
  15139.  
  15140.  
  15141.                                      Page -252-
  15142.  
  15143.  
  15144.  
  15145.  
  15146.  
  15147.                                     Appendix "E"
  15148.  
  15149.                    /* This initializes the structures to certain
  15150.                       default values (see each function description
  15151.                       for details). Once it has been initialized you
  15152.                       need to modify only the desired parameters */
  15153.  
  15154.                    ScrollWindow(SW_INIT,&swd);
  15155.  
  15156.                    /* Modify the size of our scroll window */
  15157.  
  15158.                    swd.UpperRow=6;
  15159.                    swd.LeftCol=26;
  15160.                    swd.LowerRow=17;
  15161.                    swd.RightCol=52;
  15162.  
  15163.                    /* And specify our data address */
  15164.  
  15165.                    swd.Buffer=swdbuf;
  15166.  
  15167.                 2) Defining the structure as static data:
  15168.  
  15169.                 #include <scl1.h>
  15170.  
  15171.                 /* This is the data you want to display in your
  15172.                    scroll window */
  15173.  
  15174.                 char *swdbuf[]={
  15175.                    "First Item",
  15176.                    "Second Item",
  15177.                    0};
  15178.  
  15179.                 /* All the parameters required to define the Scroll
  15180.                    Window go into this structure (size, color,
  15181.                    position, etc.). */
  15182.  
  15183.                 SWData swd={7,15,6,26,17,52,0,1,15,swdbuf,0,0," Scroll  
  15184.                 Window",7,0,0,0,0,0,0,0,0,0,0,0,0,0};
  15185.  
  15186.                 /* Since all the parameters have been defined there is
  15187.                    no need to change any of them */
  15188.  
  15189.              THE "RESET" MESSAGE:
  15190.  
  15191.                 Dialog function structures have several position related
  15192.                 variables.  When you declare your structure as static data
  15193.                 you do not need to call the function with an "INIT"
  15194.                 message.  You should call the function with a "RESET"
  15195.                 message to make sure that all these variables are reset.
  15196.                 This message also checks for undefined ExitKeys an sets
  15197.                 this element to default values if the have not been
  15198.                 defined.
  15199.  
  15200.                                      Page -253-
  15201.  
  15202.  
  15203.  
  15204.  
  15205.  
  15206.                                     Appendix "E"
  15207.  
  15208.                 Let us continue with the previous example of an application
  15209.                 of the ScrollWindow function.  Let us assume that the
  15210.                 structure has been defined as static data.  Our program
  15211.                 should look like this:
  15212.  
  15213.                 main()
  15214.                    {
  15215.  
  15216.                    /* The RESET message resets the internal position
  15217.                     related variables (in this case, it makes sure that
  15218.                     we start at the first item. It also checks for any
  15219.                     parameter that may have not been specified in the
  15220.                     structure (in this example the ExitKeys have not
  15221.                     been specified). You should always call a dialog
  15222.                     function using the "RESET" message when you are not
  15223.                     using the "INIT" message unless you desire the
  15224.                     cursor to appear over an specific item */
  15225.  
  15226.                    ScrollWindow(SW_RESET,&swd);
  15227.                    }
  15228.  
  15229.              THE "DRAW" MESSAGE:
  15230.  
  15231.                 Once your structure is defined and initialized there a lot
  15232.                 messages that you can send to it.  The first message
  15233.                 usually is "DRAW", this message instructs the function to
  15234.                 display the information to the screen.
  15235.  
  15236.                 In our example using the ScrollWindow function the "DRAW"
  15237.                 message should be sent like this:
  15238.  
  15239.                 ScrollWindow(SW_DRAW,&swd);
  15240.  
  15241.                 After sending this message you should see a the Scroll
  15242.                 Window displayed in the screen.
  15243.  
  15244.              THE "ACTIVE" MESSAGE:
  15245.  
  15246.                 The "ACTIVE" message permits you to have the function
  15247.                 perform the specific task it has been designed to do.
  15248.                 Messages are constantly returned by the dialog type
  15249.                 function.  If you are using the LineEditor function, the
  15250.                 "ACTIVE" message permits you to edit the entry field, for
  15251.                 the ScrollWindow function, this message lets you browse
  15252.                 through the window, etc.
  15253.  
  15254.  
  15255.  
  15256.  
  15257.  
  15258.  
  15259.                                      Page -254-
  15260.  
  15261.  
  15262.  
  15263.  
  15264.  
  15265.                                     Appendix "E"
  15266.  
  15267.                 When you send this message the function will retain the
  15268.                 program control until some event occurs.  For example, in
  15269.                 the case of ScrollWindow, when the user press the DOWN or
  15270.                 UP arrow keys to change the highlighted item, ScrollWindow
  15271.                 will return a NEW_POSITION message, or if you pressed an
  15272.                 undefined key (it could be F1 to request Help) an
  15273.                 ILLEGAL_KEY message is returned.  You can ignore the
  15274.                 returned message or respond to it.  In our previous example
  15275.                 of a the ScrollWindow function the code should look like
  15276.                 this:
  15277.  
  15278.                 do
  15279.                    {
  15280.                    Mess=ScrollWindow(SW_BROWSE,&swd);
  15281.                    }while(Mess != SW_EXIT_KEY);
  15282.  
  15283.                 Since when an "ACTIVE" message is sent the function retains
  15284.                 the program control until an event occurs, we should place
  15285.                 this function call within in a loop.  In this case any
  15286.                 returned message is ignored except the "EXIT_KEY" message
  15287.                 which means that a key defined as an exit key has been
  15288.                 pressed.  The user will be able to browse until one of
  15289.                 these keys is pressed.  Exit Keys can individually be
  15290.                 defined for each function.  You can add any desired Exit
  15291.                 Keys by defining a null-terminated array were all the
  15292.                 ExitKeys' SCAN/ASCII codes values are specified, for
  15293.                 example:
  15294.  
  15295.                 unsigned int MyExitKeys[]={ESC,ENTER,0};
  15296.  
  15297.                 NOTE: This example needs header file SCL1KEYS.H.
  15298.  
  15299.                 Once you have defined your Exits Keys you initialize the
  15300.                 structure ExitKeys element:
  15301.  
  15302.                 swd.ExitKeys=MyExitKeys;
  15303.  
  15304.                 You can also call the function with the "INIT" and "RESET"
  15305.                 messages to set the ExitKeys to default values (see each
  15306.                 function description)
  15307.  
  15308.              THE "POSITION_BEGIN" MESSAGE
  15309.  
  15310.                 When you call the function with this message the cursor
  15311.                 moves to the start of the data buffer.
  15312.  
  15313.  
  15314.  
  15315.  
  15316.  
  15317.  
  15318.                                      Page -255-
  15319.  
  15320.  
  15321.  
  15322.  
  15323.  
  15324.                                     Appendix "E"
  15325.  
  15326.              The "POSITION_END" MESSAGE
  15327.  
  15328.                 When you call the function with this message the cursor
  15329.                 moves to the end of the data buffer.
  15330.  
  15331.              The "POSITION_UP" MESSAGE
  15332.  
  15333.                 When you call the function with this message the cursor
  15334.                 moves one position towards the end of the data buffer in
  15335.                 the LineEditor function, to the next field for the Fields2
  15336.                 function and to the next item in all other functions.
  15337.  
  15338.              The "POSITION_DOWN" MESSAGE
  15339.  
  15340.                 When you call the function with this message the cursor
  15341.                 moves one position towards the start of the data buffer in
  15342.                 the LineEditor function, to the next field for the Fields2
  15343.                 function and to the next item in all other functions.
  15344.  
  15345.              The "SET_POSITION" MESSAGE
  15346.  
  15347.                 When you call the function with this message the cursor
  15348.                 moves to the specified position.  This function call
  15349.                 requires you to send an additional parameter (see
  15350.                 explanation below).
  15351.  
  15352.              The "CHECK_MOUSE" MESSAGE
  15353.  
  15354.                 Normally Dialog type functions handle the mouse input by
  15355.                 themselves but when you have several Dialog type functions
  15356.                 at the same time on the screen and your program detects
  15357.                 that the mouse has been clicked you can send this message
  15358.                 to any dialog function.  If the mouse was clicked inside a
  15359.                 function screen area it will return a MY_MOUSE message, in
  15360.                 any other case it returns a MOUSE_EVENT message.  This call
  15361.                 is useful for determining under what conditions the mouse
  15362.                 has been clicked.
  15363.  
  15364.           MESSAGES THAT DIALOG TYPE FUNCTIONS CAN RETURN
  15365.  
  15366.              THE "OK" MESSAGE.
  15367.  
  15368.                 This message is returned when you have called a Dialog type
  15369.                 function with the "DRAW", "INIT" or "RESET" messages, and
  15370.                 the action was performed as requested.
  15371.  
  15372.  
  15373.  
  15374.  
  15375.  
  15376.  
  15377.                                      Page -256-
  15378.  
  15379.  
  15380.  
  15381.  
  15382.  
  15383.                                     Appendix "E"
  15384.  
  15385.              THE "EXIT_KEY" MESSAGE.
  15386.  
  15387.                 This message is returned when one of the keys, defined as
  15388.                 an Exit Key, has been pressed.  It's SCAN/ASCII code is
  15389.                 stored in the structure element "EventInfo".
  15390.  
  15391.              THE "ILLEGAL_KEY" MESSAGE:
  15392.  
  15393.                 Each function uses several keys (like PgUp, PgDn etc.) to
  15394.                 perform common operations and checks for the use of the
  15395.                 defined ExitKeys. If any other key is pressed, it returns
  15396.                 an ILLEGAL_KEY message and stores the key's SCAN/ASCII code
  15397.                 in the structure's EventInfo element.
  15398.  
  15399.                 You can respond to this message for performing a given
  15400.                 action.  Let us see an example in which we use the
  15401.                 ILLEGAL_KEY message to display a help screen and at the
  15402.                 same time display the highlighted item in a secondary
  15403.                 window:
  15404.  
  15405.                 do
  15406.                    {
  15407.                    Mess=ScrollWindow(SW_ACTIVE,&swd);
  15408.  
  15409.                    if(Mess==SW_ILLEGAL_KEY)  /* Illegal key pressed? */
  15410.  
  15411.                        {
  15412.  
  15413.                        /* The structure's EventInfo element is common to
  15414.                           all Dialog function. It holds the value of the
  15415.                           key that was pressed when you receive and
  15416.                           EXIT_KEY or ILLEGAL KEY message. */
  15417.  
  15418.                        if(swd.EventInfo == F1)    /* Help Key? */
  15419.  
  15420.                        ... Display help code would go here ....
  15421.  
  15422.                    else              /* Unknown key */
  15423.  
  15424.                        ... Display error message, beep etc.
  15425.  
  15426.                        }
  15427.  
  15428.                        /* Let's now display the highlighted item in a
  15429.                           secondary window, the structure Position
  15430.                           element can be used as an index to our data
  15431.                           array */
  15432.  
  15433.                        WriteScreen(7,24,30,swdbuf[swd.Position]);
  15434.                    }while(Mess != SW_EXIT_KEY);
  15435.  
  15436.                                      Page -257-
  15437.  
  15438.  
  15439.  
  15440.  
  15441.  
  15442.                                     Appendix "E"
  15443.  
  15444.                 You can send other messages while you're inside this loop.
  15445.                 For example, in this loop the item at the cursor position
  15446.                 is deleted from the list when the DELETE key is pressed:
  15447.  
  15448.                 do
  15449.                    {
  15450.                    Mess=ScrollWindow(SW_BROWSE,&swd);
  15451.  
  15452.                    if(Mess == SW_ILLEGAL_KEY && swd.EventInfo == DEL)
  15453.  
  15454.                        {
  15455.  
  15456.                        /* DeleteItem would be an user defined function
  15457.                           that deletes an item from your list */
  15458.  
  15459.                        DeleteItem(swd.Position);
  15460.  
  15461.                        /* Now redraw your data */
  15462.  
  15463.                    Mess=ScrollWindow(SW_DRAW,&swd);
  15464.  
  15465.                    }while(Mess != SW_EXIT_KEY);
  15466.  
  15467.              THE "MOUSE EVENT" MESSAGE
  15468.  
  15469.                 This message is returned when the mouse has been clicked
  15470.                 outside the function screen area.  You can check mouse
  15471.                 variables MSE_LpX and MSE_LpY to get the actual position
  15472.                 were the mouse was clicked.
  15473.  
  15474.              THE "MY_MOUSE" MESSAGE
  15475.  
  15476.                 When you send a "CHECK_MOUSE" message to a dialog function
  15477.                 it checks if the mouse was clicked inside it's screen area.
  15478.                 In this case it will return a "MY_MOUSE" message. You can
  15479.                 then send an "ACTIVE" messages so that the function gets
  15480.                 control and services the mouse event.  In the case the
  15481.                 mouse was clicked outside it's screen area a "MOUSE_EVENT"
  15482.                 message is returned.
  15483.  
  15484.              THE "BUFFER_END" MESSAGE
  15485.  
  15486.                 This message is returned when the user has tried to move
  15487.                 the cursor passed the last element (or end) of the buffer.
  15488.                 This message can be safely ignored unless you want to
  15489.                 display an error or warning. (This message is not supported
  15490.                 by all Dialog functions).
  15491.  
  15492.  
  15493.  
  15494.  
  15495.                                      Page -258-
  15496.  
  15497.  
  15498.  
  15499.  
  15500.  
  15501.                                     Appendix "E"
  15502.  
  15503.              THE "BUFFER_BEGIN" MESSAGE
  15504.  
  15505.                 This message is returned when the user has tried to move
  15506.                 the cursor passed the first element (or beginning) of
  15507.                 buffer. This message can be safely ignored unless you want
  15508.                 to display an error or warning. (This message is not
  15509.                 supported by all Dialog functions).
  15510.  
  15511.              THE "ILLEGAL_POSITION" MESSAGE
  15512.  
  15513.                 This message is returned when you send a "SET_POSITION"
  15514.                 message but the position parameter is not valid.
  15515.  
  15516.              THE "NEW_POSITION" MESSAGE
  15517.  
  15518.                 This message is returned when the user has moved the cursor
  15519.                 to a new position. You can get the current position from
  15520.                 the "Position" structure element.
  15521.  
  15522.           Every effort has been made to make these functions to be called
  15523.           very similarly.
  15524.  
  15525.  
  15526.           STRUCTURE ELEMENTS COMMON TO ALL DIALOG FUNCTIONS:
  15527.  
  15528.           The following structure elements are common to all Dialog type
  15529.           functions:
  15530.  
  15531.               Colors - Colors are defined using one or more of the
  15532.                        following structure elements:
  15533.  
  15534.                      Color -   For functions that use only one color.
  15535.  
  15536.                 Functions that use more than one color:
  15537.  
  15538.                     NColor -   Normal Color
  15539.                     RColor -   Reversed Color
  15540.                     HColor -   Highlight Color
  15541.                     TColor -   Color used to tag items.
  15542.  
  15543.             Screen Position -  Screen coordinates are specified using one
  15544.                                or more of the following structure elements:
  15545.  
  15546.                    Row,Col - Row & column position.
  15547.  
  15548.                    UpperRow,LowerRow,LeftCol,RightCol - Used in functions
  15549.                    that must define a screen area. UpperRow/LeftCol
  15550.                    indicate the window's top left coordinate and
  15551.                    LowerRow/RightCol the lower right corner.
  15552.  
  15553.  
  15554.                                      Page -259-
  15555.  
  15556.  
  15557.  
  15558.  
  15559.  
  15560.                                     Appendix "E"
  15561.  
  15562.              EventInfo - When the user press an undefined key or an exit
  15563.                          key it's SCAN/ASCII code value is stored in this
  15564.                          element.
  15565.  
  15566.              ExitKeys -  Pointer to a null-terminated array of unsigned
  15567.                          integers. It must be initialized to the SCAN/ASCII
  15568.                          code values of the keys that are to be defined as
  15569.                          ExitKeys. (see the examples above). 
  15570.  
  15571.                 NOTE: ExitKeys are checked by Dialog Functions before the
  15572.                 default editing keys. This means you can override a defined
  15573.                 editing key or invalidate its use by defining it as an
  15574.                 ExitKey.
  15575.  
  15576.              Position -  This element holds the current cursor position.
  15577.                          Some functions may have more than one variable.
  15578.  
  15579.           ADDITIONAL PARAMETERS 
  15580.  
  15581.              Some messages (for example SET_POSITION) require that you send
  15582.           an additional parameter. This parameter is always the last
  15583.           parameter:
  15584.  
  15585.              NewPosition=123;
  15586.              ScrollWindow(SW_SET_POSITION,&swd,NewPosition);
  15587.  
  15588.           In this example, the new position is specified by the NewPosition
  15589.           variable.
  15590.  
  15591.           FUNCTIONS DERIVED FROM DIALOG FUNCTIONS
  15592.  
  15593.           Dialog functions offer a lot of power and flexibility.  Several
  15594.           of the new functions included in this version of SCL1 utilize
  15595.           them.  These new functions follow the general working procedure
  15596.           of the "INIT", "RESET", "DRAW" and "ACTIVE" messages previously
  15597.           described, but the retain the program control until on of the
  15598.           ExitKeys is pressed.  In future versions of SCL1 a monitoring
  15599.           facility will be added to this functions to improve their
  15600.           flexibility.  The FileBox2 and WFileBox are examples of these
  15601.           dialog derived functions.  The next example shows how to use
  15602.           these functions:
  15603.  
  15604.  
  15605.  
  15606.  
  15607.  
  15608.  
  15609.  
  15610.  
  15611.  
  15612.  
  15613.                                      Page -260-
  15614.  
  15615.  
  15616.  
  15617.  
  15618.  
  15619.                                     Appendix "E"
  15620.  
  15621.              #include <scl1.h>
  15622.  
  15623.              main()
  15624.              {
  15625.              FBData fbd;
  15626.              char buffer[80];
  15627.  
  15628.              memset(buffer,0,sizeof(buffer));
  15629.              FileBox2(FB_INIT,&fbd); /* Initialize */
  15630.  
  15631.              fbd.UpperRow=10;     /* Modify size & position */
  15632.              fbd.LeftCol=20;
  15633.              fbd.LowerRow=20;
  15634.              fbd.RightCol=60;
  15635.              fbd.Buffer=buffer;      /* Use our buffer */
  15636.  
  15637.              FileBox2(FB_DRAW,&fbd);
  15638.              FileBox2(FB_ACTIVE,&fbd);
  15639.              }
  15640.  
  15641.           Its important to know if a function is a true DIALOG function or
  15642.           a DIALOG-DERIVED function.
  15643.  
  15644.  
  15645.  
  15646.  
  15647.  
  15648.  
  15649.  
  15650.  
  15651.  
  15652.  
  15653.  
  15654.  
  15655.  
  15656.  
  15657.  
  15658.  
  15659.  
  15660.  
  15661.  
  15662.  
  15663.  
  15664.  
  15665.  
  15666.  
  15667.  
  15668.  
  15669.  
  15670.  
  15671.  
  15672.                                      Page -261-
  15673.  
  15674.  
  15675.  
  15676.  
  15677.  
  15678.                                     Appendix "F"
  15679.  
  15680.  
  15681.                              CHANGES IN SCL1 version 2.0
  15682.  
  15683.           For several reasons we have been forced to make various changes
  15684.           that make version 2.0 incompatible with version 1.1 in some
  15685.           aspects:
  15686.  
  15687.           SCL1's global variables -
  15688.  
  15689.              Some of SCL1's global variables were not originally intended
  15690.              to be made accessible to non-library functions, in fact some
  15691.              of them were not even documented.  They were given names in
  15692.              capital letters (like MOUSE_FLAG). This can create a confusion
  15693.              since capital letters are generally used in C language for
  15694.              #define directive constants.  We have changed all global
  15695.              variables names in order prevent this confusion . Every
  15696.              variable now has a prefix that identifies the function that
  15697.              declares the variable, for example all mouse variables start
  15698.              with MSE, while all Video variables declared in function
  15699.              VideoConfig start with VC.  Following the prefix is the
  15700.              variable name, for example MSE_MouseFl, VC_VideoSeg etc.  If
  15701.              you have a big program that uses a lot of these variables and
  15702.              you don't want to change them all you can use SCL1OLD.H header
  15703.              file that redefines all identifiers to new names. Take a look
  15704.              at this file for a complete list of modified variables.
  15705.  
  15706.           SCL1's constants -
  15707.  
  15708.              Several constants in SCL1 were not defined using uppercase as
  15709.              it is traditionally done in C.  For example in version 1.?
  15710.              "LETTER" is used by GetString to accept capitalize letters
  15711.              while "letter" to accept letters but without capitalization.
  15712.              In version 2.0 all constants are uppercase.  As with global
  15713.              variables the SCL1OLD.H file redefines all identifiers to new
  15714.              names.
  15715.  
  15716.           Function arguments-
  15717.  
  15718.              Several SCL1 functions received arguments of type char. Most
  15719.              of the times is more efficient to pass arguments of the
  15720.              integer type even if the extra storage space is not needed.
  15721.              All arguments of type char has been modified to type integer.
  15722.              This should not represent problems but you should not mix
  15723.              program modules compiled using version 1 with modules compiled
  15724.              with version 2.
  15725.  
  15726.  
  15727.  
  15728.  
  15729.  
  15730.  
  15731.                                      Page -262-
  15732.  
  15733.  
  15734.  
  15735.  
  15736.  
  15737.                                     Appendix "F"
  15738.  
  15739.           New functions-
  15740.  
  15741.           Video related - SCL1 now supports CGA 40 columns mode as well as
  15742.           EGA 43 lines and VGA 50 lines video modes. Video-pages are also
  15743.           supported. The following new functions have been added:
  15744.  
  15745.                    Center
  15746.                    DrawBoxLine
  15747.                    DrawLine
  15748.                    ErrorShadowOff
  15749.                    ErrorShadowOn
  15750.                    FillBlock
  15751.                    Int24ShadowOff
  15752.                    Int24ShadowOn
  15753.                    MessageShadowOff
  15754.                    MessageShadowOn
  15755.                    PushCursor
  15756.                    PopCursor
  15757.                    SetInt24Colors
  15758.                    SetErrorBoxColor
  15759.                    SetDialogColor
  15760.                    SetShadowColor
  15761.                    SetUserBox
  15762.                    SetUserBoxLine
  15763.                    SetVideoMode
  15764.                    SetVideoPage
  15765.                    SetVideo4350
  15766.                    SetVideo25
  15767.                    VideoConfig
  15768.                    WriteOffLen
  15769.                    WriteOffset
  15770.                    WriteScreenLen
  15771.                    YesNoShadowOff
  15772.                    YesNoShadowOn
  15773.  
  15774.           Dialog functions - This is probably the most important addition
  15775.           to version 2. Please refer to Dialog Functions (Appendix "E").
  15776.           New functions:
  15777.  
  15778.                    Calendar
  15779.                    FieldCheck
  15780.                    Fields2
  15781.                    FileBox2
  15782.                    LineEditor
  15783.                    ListWindow
  15784.                    LW_MoveTo
  15785.                    MenuSystem
  15786.                    MouseButton
  15787.                    ScrollWindow
  15788.                    Select
  15789.  
  15790.                                      Page -263-
  15791.  
  15792.  
  15793.  
  15794.  
  15795.  
  15796.                                     Appendix "F"
  15797.  
  15798.                    SW_MoveTo
  15799.                    TagList2
  15800.                    TextWindow
  15801.  
  15802.           Mouse functions - Double click is now supported. You can also
  15803.           modify the mouse cursor appearance. The InitMouse function
  15804.           simplifies initialization process. New functions:
  15805.  
  15806.                    InitMouse
  15807.                    ResetMouseCur
  15808.                    SetMouseCur
  15809.  
  15810.           File functions - Several optimizations have been performed. A bug
  15811.           in GetFileSize that trashed the file read/write pointer was
  15812.           fixed. FileBox has been greatly improved and several new options
  15813.           are available through the use of FileBox2 and WFileBox (see
  15814.           Dialog functions). New functions:
  15815.  
  15816.                    FindFirst
  15817.                    FindNext
  15818.  
  15819.  
  15820.  
  15821.  
  15822.  
  15823.  
  15824.  
  15825.  
  15826.  
  15827.  
  15828.  
  15829.  
  15830.  
  15831.  
  15832.  
  15833.  
  15834.  
  15835.  
  15836.  
  15837.  
  15838.  
  15839.  
  15840.  
  15841.  
  15842.  
  15843.  
  15844.  
  15845.  
  15846.  
  15847.  
  15848.  
  15849.                                      Page -264-
  15850.  
  15851.  
  15852.  
  15853.  
  15854.  
  15855.                                     Appendix "F"
  15856.  
  15857.  
  15858.                               REGISTRATION INFORMATION
  15859.  
  15860.           SCL1 C function Library Version 1.1 is copyrighted by José
  15861.           Rodríguez Alvira & José R. Lebrón.  You don't have to pay any
  15862.           royalties to use SCL1 in your programs.  To Register as a SCL1
  15863.           user and to obtain a copy of SCL1 libraries for the Small,
  15864.           Medium, Compact, Large and Huge memory models send $30.00 (or
  15865.           $60.00 to also get the source code) to:
  15866.  
  15867.                        José Rodríguez Alvira
  15868.                        El Monte Sur 190, Apt. B-342,
  15869.                        Hato Rey, Puerto Rico, 00918
  15870.  
  15871.           You will receive by mail the latest version of the SCL1 library
  15872.           for the compiler of your choice, and a free copy of a Full-Screen
  15873.           Extended ASCII Editor called SSG, that generates the source code
  15874.           of your screens using SCL1's functions (The SCL1DEMO was done
  15875.           with the help of SSG).  You will be notified of any future
  15876.           additions or revisions to SCL1 and of any other program
  15877.           developed.
  15878.  
  15879.           You are encouraged to share the Demo Distribution disk with your
  15880.           friends.  The full version that you obtain upon registration is
  15881.           not intended for free distribution and should not be shared with
  15882.           others.
  15883.  
  15884.           The latest version of SCL1, sample programs and comments about
  15885.           these programs are available in:
  15886.  
  15887.                    TECH BBS (Sysop: José Romero)
  15888.                    (809)732-2322
  15889.  
  15890.           You can leave any comments, suggestions or questions in this BBS. 
  15891.           We will reply these messages in the same BBS.
  15892.  
  15893.  
  15894.  
  15895.  
  15896.  
  15897.  
  15898.  
  15899.  
  15900.  
  15901.  
  15902.  
  15903.  
  15904.  
  15905.  
  15906.  
  15907.  
  15908.                                      Page -265-
  15909.